Browse Source

Merge pull request #1204 from anapple/chromium-fun

Make chrome extensions compatible with latest API changes.
notmasteryet 13 years ago
parent
commit
e00aa8e90b
  1. 4
      README.md
  2. 2
      extensions/chrome/manifest.json
  3. 2
      extensions/chrome/pdfHandler.html

4
README.md

@ -37,8 +37,8 @@ auto-update extensions on a daily basis (you can change this through the
`extensions.update.interval` option in `about:config`). `extensions.update.interval` option in `about:config`).
For an experimental Chrome extension, get the code as explained below and issue `make extension`. For an experimental Chrome extension, get the code as explained below and issue `make extension`.
Then open Chrome with the flag `--enable-experimental-extension-apis`, go to `Tools > Extension` Then open Chrome, go to `Tools > Extension` and load the (unpackaged) extension
and load the (unpackaged) extension from the directory `extensions/chrome`. from the directory `build/chrome`.
### Getting the code ### Getting the code

2
extensions/chrome/manifest.json

@ -3,7 +3,7 @@
"version": "0.1", "version": "0.1",
"description": "Read PDF Document", "description": "Read PDF Document",
"permissions": [ "permissions": [
"experimental", "webRequest", "webRequestBlocking",
"http://*/*.pdf", "http://*/*.pdf",
"file:///*/*.pdf" "file:///*/*.pdf"
], ],

2
extensions/chrome/pdfHandler.html

@ -1,6 +1,6 @@
<!doctype html> <!doctype html>
<script> <script>
chrome.experimental.webRequest.onBeforeRequest.addListener( chrome.webRequest.onBeforeRequest.addListener(
function(details) { function(details) {
var viewerPage = 'content/web/viewer.html'; var viewerPage = 'content/web/viewer.html';
var url = chrome.extension.getURL(viewerPage) + '?file=' + details.url; var url = chrome.extension.getURL(viewerPage) + '?file=' + details.url;

Loading…
Cancel
Save