diff --git a/Makefile b/Makefile
index 80003bdf6..3484ab414 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-REPO = git@github.com:andreasgal/pdf.js.git
+REPO = git@github.com:mozilla/pdf.js.git
BUILD_DIR := build
BUILD_TARGET := $(BUILD_DIR)/pdf.js
DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json
diff --git a/README.md b/README.md
index 42669da28..8414ad2a9 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ successful.
For an online demo, visit:
-+ http://andreasgal.github.com/pdf.js/web/viewer.html
++ http://mozilla.github.com/pdf.js/web/viewer.html
This demo provides an interactive interface for displaying and browsing PDFs
using the pdf.js API.
@@ -31,7 +31,7 @@ using the pdf.js API.
A Firefox extension is also available:
-+ http://andreasgal.github.com/pdf.js/extensions/firefox/pdf.js.xpi
++ http://mozilla.github.com/pdf.js/extensions/firefox/pdf.js.xpi
However, note that the extension might not reflect the latest source in our master branch.
@@ -39,7 +39,7 @@ However, note that the extension might not reflect the latest source in our mast
To get a local copy of the current code, clone it using git:
- $ git clone git://github.com/andreasgal/pdf.js.git pdfjs
+ $ git clone git://github.com/mozilla/pdf.js.git pdfjs
$ cd pdfjs
Next, you need to start a local web server as some browsers don't allow opening
@@ -73,7 +73,7 @@ Additional resources are available in a separate section below.
For a "hello world" example, take a look at:
-+ [examples/helloworld/hello.js](https://github.com/andreasgal/pdf.js/blob/master/examples/helloworld/hello.js)
++ [examples/helloworld/hello.js](https://github.com/mozilla/pdf.js/blob/master/examples/helloworld/hello.js)
This example illustrates the bare minimum ingredients for integrating pdf.js
in a custom project.
@@ -92,19 +92,19 @@ workings of PDF and pdf.js:
pdf.js is a community-driven project, so contributors are always welcome.
Simply fork our repo and contribute away. A great place to start is our
-[open issues](https://github.com/andreasgal/pdf.js/issues). For better consistency and
+[open issues](https://github.com/mozilla/pdf.js/issues). For better consistency and
long-term stability, please do look around the code and try to follow our conventions.
More information about the contributor process can be found on the
-[contributor wiki page](https://github.com/andreasgal/pdf.js/wiki/Contributing).
+[contributor wiki page](https://github.com/mozilla/pdf.js/wiki/Contributing).
If you don't want to hack on the project or have little spare time, __you still
can help!__ Just open PDFs in the
-[online demo](http://andreasgal.github.com/pdf.js/web/viewer.html) and report
+[online demo](http://mozilla.github.com/pdf.js/web/viewer.html) and report
any breakage in rendering.
Our Github contributors so far:
-+ https://github.com/andreasgal/pdf.js/contributors
++ https://github.com/mozilla/pdf.js/contributors
You can add your name to it! :)
@@ -143,14 +143,14 @@ against reference images before merging pull requests.
See the bot repo for details:
-+ https://github.com/arturadib/pdf.js-bot
++ https://github.com/mozilla/pdf.js-bot
## Additional resources
Our demo site is here:
-+ http://andreasgal.github.com/pdf.js/web/viewer.html
++ http://mozilla.github.com/pdf.js/web/viewer.html
You can read more about pdf.js here:
diff --git a/extensions/firefox/bootstrap.js b/extensions/firefox/bootstrap.js
index 5384a05df..e51df28f8 100644
--- a/extensions/firefox/bootstrap.js
+++ b/extensions/firefox/bootstrap.js
@@ -16,21 +16,31 @@ function log(str) {
function startup(aData, aReason) {
let manifestPath = 'chrome.manifest';
- let file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
+ let manifest = Cc['@mozilla.org/file/local;1']
+ .createInstance(Ci.nsILocalFile);
try {
- file.initWithPath(aData.installPath.path);
- file.append(manifestPath);
- Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
+ manifest.initWithPath(aData.installPath.path);
+ manifest.append(manifestPath);
+ Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(manifest);
+ Services.prefs.setBoolPref('extensions.pdf.js.active', true);
} catch (e) {
log(e);
}
}
function shutdown(aData, aReason) {
+ if (Services.prefs.getBoolPref('extensions.pdf.js.active'))
+ Services.prefs.setBoolPref('extensions.pdf.js.active', false);
}
function install(aData, aReason) {
let url = 'chrome://pdf.js/content/web/viewer.html?file=%s';
Services.prefs.setCharPref('extensions.pdf.js.url', url);
+ Services.prefs.setBoolPref('extensions.pdf.js.active', false);
+}
+
+function uninstall(aData, aReason) {
+ Services.prefs.clearUserPref('extensions.pdf.js.url');
+ Services.prefs.clearUserPref('extensions.pdf.js.active');
}
diff --git a/extensions/firefox/components/pdfContentHandler.js b/extensions/firefox/components/pdfContentHandler.js
index 7746e41b6..444db1c1f 100644
--- a/extensions/firefox/components/pdfContentHandler.js
+++ b/extensions/firefox/components/pdfContentHandler.js
@@ -32,6 +32,9 @@ pdfContentHandler.prototype = {
if (!(aRequest instanceof Ci.nsIChannel))
throw NS_ERROR_WONT_HANDLE_CONTENT;
+ if (!Services.prefs.getBoolPref('extensions.pdf.js.active'))
+ throw NS_ERROR_WONT_HANDLE_CONTENT;
+
let window = null;
let callbacks = aRequest.notificationCallbacks ||
aRequest.loadGroup.notificationCallbacks;
@@ -53,7 +56,7 @@ pdfContentHandler.prototype = {
throw NS_ERROR_WONT_HANDLE_CONTENT;
aRequest.cancel(Cr.NS_BINDING_ABORTED);
- window.location = url.replace('%s', targetUrl);
+ window.location = url.replace('%s', encodeURIComponent(targetUrl));
},
classID: Components.ID('{2278dfd0-b75c-11e0-8257-1ba3d93c9f1a}'),
diff --git a/extensions/firefox/install.rdf b/extensions/firefox/install.rdf
index 0dfd6bf57..26b2192b6 100644
--- a/extensions/firefox/install.rdf
+++ b/extensions/firefox/install.rdf
@@ -19,6 +19,6 @@
true
Vivien Nicolas
pdf.js uri loader
- https://github.com/andreasgal/pdf.js/
+ https://github.com/mozilla/pdf.js/
diff --git a/src/canvas.js b/src/canvas.js
index d5db79446..1ed1ab76d 100644
--- a/src/canvas.js
+++ b/src/canvas.js
@@ -1,8 +1,11 @@
-//