Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update/Tweak installed Google Chrome Extension for local file access

I have installed a handy Google Chrome extension that parses the DOM and shows the Document Outline.

The only problem is that it doesn't seem to work with local HTML files, such as:

file:///Users/Me/Desktop/OutlineTest.html

I went to the Extension preferences and noticed that another extension I like (The Microformats Parser) has a checkbox for "Allow access to file URLs".

So I went poking around and found that the main difference between the two extensions are that in the Microformats extension, it has the following in manifest.json:

"matches": [ "http://*/*", "https://*/*", "file://*/*" ]

While the Outliner manifest has:

"matches": [ "http://*/*", "https://*/*" ]

So I added the file protocol to the Outliner manifest and restarted Chrome, but the "Allow access to file URLs" is not showing up.

In case it matters, I'm running the newest public release of Chrome, with Developer mode for extensions disabled, on OSX Snow Leopard, and the manifest files I modified were at: ~/Library/Application Support/Google/Chrome/Default/Extensions/.

So this raises a few questions:

  1. Can Chrome extensions be modified post-install (as described above) or does the extension need to be rebuilt/reinstalled with the modifications?

  2. Is there somewhere else in the extension that needs to be modified before the extension can be given rights to local files?

  3. Why doesn't Google just have local file access as a default option for extensions, since it's turned off by default, hidden in the extension preferences, and likely to only be enabled by people who actually know the risk of enabling it? (This is obviously rhetorical, but I think a valid question for any Chrome developers out there who read this).

like image 971
Anthony Avatar asked Mar 24 '12 08:03

Anthony


People also ask

Where do I point the update_URL for Chrome extensions?

On Windows and Mac, the update_URL must point to the Chrome Web Store where the extension must be hosted. The preferences file on Linux can point to your own server where you are hosting the extension. The preferences JSON file also supports installing an extension from a .crx extension file on the user's Linux computer.

How to update Google Chrome to the latest version?

Open a new tab and go to chrome://extensions. Switch on the Developer mode toggle. When developer mode is enabled, you will see additional options on the page. Click Update. Google Chrome will now download and install the latest version of Google Chrome extensions.

How do I find the version of a Chrome extension?

The extension's version (from the manifest file or the chrome://extensions page) The extension's ID (from the chrome://extensions page when you've loaded the packed extension) The following examples assume the version is 1.0 and the ID is aaaaaaaaaabbbbbbbbbbcccccccccc. Mac OS X and Linux only: Do not use the preferences file for Windows.

Why can’t I see my external extensions on Chrome?

On Mac OS, the external extensions files for all users are only read if file system permissions prevent unprivileged users from changing it. If you do not see external extensions installed when Chrome is launched, there may be a permissions problem with the external extensions preferences files. To see if this is the problem, follow these steps:


1 Answers

I figured it out. I was going to delete, but thought this might help others looking to do the same thing.

How to reload extension with modifications:

  1. Check box for Developer Mode
  2. Select "Load Unpacked Extension" button
  3. Point dialog box to the extension source (all the way to the directory which contains the manifest file)

You can now turn off developer mode (if you want), and the changes will still be in place.

Of course, if anyone has a better solution or knows why this one is not totally accurate, by all means, post the answer an I'll accept it.

like image 102
Anthony Avatar answered Sep 22 '22 05:09

Anthony