

Unfortunately, these original paths are not recorded in the resources.pak file. Now, in the original Chrome source tree, these files all had sensible paths, such as chrome/browser/resources/pdf/pdf_viewer.js. Once you've found it, copy it, make a backup, and unpack it: cd ~/code/chromeĬhromePAK-V5/ChromePAK-V5 -c=unpack -f=resources.pakĪt this point, the files we need will be located somewhere in the resources directory. In my case, running Chromium on Linux, the file is located at /usr/lib/chromium/resources.pak, but it might be somewhere else for you. Now that we've got the binary ChromePAK-V5/ChromePAK-V5, we can use it to unpack resources.pak.

~/go/bin/go-bindata -nomemcopy -o assets.go assets Here's how I went about it: cd ~/code/chrome We also need to install a build-time dependency called go-bindata. It's written in Go, so we need that to build it. The only one that I know of is ChromePAK-V5. The first thing we need is a tool that can unpack resources.pak. What we need to do is unpack resources.pak on disk, edit the files that style the PDF viewer, and then repack the bundle. When Chrome is built, these "resources" are bundled together into a single file, resources.pak, which the browser unpacks into memory during startup. The Chrome source tree contains thousands of HTML, JS, and CSS files that control the behavior and appearance of many parts of the browser, including the PDF viewer. It's so much easier on my eyes compared to the default background, which, when inverted, is blindingly bright. I like to change the PDF viewer's background to white, so that when I activate the color-inverting Deluminate extension at night, I get a nice solid black background. Still, to me, the effort is well worth it. Thanks, Google.Īs a matter of fact, there is a way, but we've got to get our hands dirty, and the process must be repeated every time we update Chrome. It should still be possible to download the Chromium source, edit the files described below, and then recompile, but that's much more painful than simply hacking resources.pak. Update: Recent versions of Chrome seem to have moved the PDF viewer resources out of resources.pak and into the browser binary itself.
