Commit Graph

615 Commits

Author SHA1 Message Date
Rob Wu
fc83ce1aae [CRX] Restore migration logic for managed enableHandToolOnLoad pref
This partially reverts df0836b9b8.
The entry in preferences_schema.json is restored because that is
required to make managed preferences visible to the extension code.

The default key is still removed from default_preferences.json,
because this change only concerns the Chrome extension, not the
other parts of PDF.js. To account for the missing key, the
deprecated key was added back in chromecom.js

The key needs to be restored in preferences_schema.json too,
because that's the only way to make managed preferences visible.

I'm using `Object.assign`, which was introduced in Chrome 45,
so the preference module will break in Chrome 45 and earlier.
This is fine, because we do not support Chrome before 49.
2018-02-18 11:56:27 +01:00
Tim van der Meij
538dda1096
Merge pull request #9479 from Snuffleupagus/refactor-viewer-options
[api-major] Refactor viewer components initialization to reduce their dependency on the global `PDFJS` object
2018-02-14 22:47:33 +01:00
Jonas Jenwald
a1cfa5f4d7 Replace the disableTextLayer and enhanceTextSelection options/preferences with a single textLayerMode option/preference
Rather than having two different (but connected) options for the textLayer, I think that it makes sense to try and unify this. For example: currently if `disableTextLayer === true`, then the value of `enhanceTextSelection` is simply ignored.

Since PDF.js version `2.0` already won't be backwards compatible in lots of ways, I don't think that we need to worry about migrating existing preferences here.
2018-02-13 16:56:54 +01:00
Jonas Jenwald
90ab9bafff Remove the actual enableHandToolOnLoad preference (PR 9040 follow-up)
This should have been removed as part of PR 9040, but was simply overlooked.
2018-02-13 09:36:53 +01:00
Jonas Jenwald
1cf116ab88 Enable the mozilla/use-includes-instead-of-indexOf ESLint rule globally
This rule is available from https://www.npmjs.com/package/eslint-plugin-mozilla, and is enforced in mozilla-central. Note that we have the necessary `Array`/`String` polyfills and that most cases have already been fixed, see PRs 9032 and 9434.
2018-02-10 23:24:50 +01:00
Jonas Jenwald
59028bac42 Upstream the changes from: Bug 1432992 - Remove definitions of Ci, Cr, Cc, and Cu
Please see:
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1432992
 - https://hg.mozilla.org/integration/autoland/rev/b38d59f71915
2018-02-09 12:49:02 +01:00
Rob Wu
352389c0c6 [CRX] Expose some headers to fetch requests 2018-02-06 15:06:02 +01:00
Jonas Jenwald
77135a2bc4 [Firefox addon] Adjust the minVersion numbers in install.rdf and update.rdf
After the latest update of the minimum supported Firefox version, the development addon is no longer being signed. Hence this patch attempts to address that, by pinning the `minVersion` to a specific version number instead.

*Please note:* The version numbers were taken from https://addons.mozilla.org/en-US/firefox/pages/appversions/, so it ought to have worked.
2018-02-05 13:56:34 +01:00
Tim van der Meij
db9f71fe6b
Merge pull request #9433 from Snuffleupagus/addon-minimum-nightly
[Firefox addon] Change the minimum supported version to Firefox Nightly, and remove no longer needed fallback code
2018-02-04 16:24:39 +01:00
Jonas Jenwald
712090eff8 Upstream the changes from: Bug 1339461 - Convert foo.indexOf(...) == -1 to foo.includes() and implement an eslint rule to enforce this
Yet another case where PDF.js code was modified in `mozilla-central` without the changes happening in the GitHub repo first; *sigh*.
If we don't upstream at least the changes in `extensions/firefox/`, any future update of PDF.js in `mozilla-central` will be blocked.

Please see:
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1339461
 - https://hg.mozilla.org/mozilla-central/rev/d5a5ad1dbbf2
2018-02-04 14:59:27 +01:00
Jonas Jenwald
986c8b56ca Update the eslint-plugin-mozilla package to the latest version
With the updated compatibility for the addon, we can thus remove a few no longer needed exceptions from `extensions/firefox/.eslintrc`.
2018-02-04 14:07:18 +01:00
Jonas Jenwald
4db49b6613 Upstream the changes from: Bug 1431533 - Add ChromeUtils helpers for lazy module import
Please see:
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1431533
 - https://hg.mozilla.org/mozilla-central/rev/e6a7b5e11ba8
 - https://groups.google.com/forum/#!topic/mozilla.dev.platform/xQaTdsrbd-g
2018-02-04 14:07:18 +01:00
Jonas Jenwald
08b2e25ac1 [Firefox addon] Remove no longer needed fallback code for older versions of Firefox 2018-02-04 14:07:18 +01:00
Jonas Jenwald
d1ffd61093 [Firefox addon] Change the minimum supported version to (the current) Firefox Nightly release
At this point in time, trying to keep the development addon compatible with prior Firefox versions is already quite difficult and will become even harder very soon.

Please keep in mind that since Firefox 57, only WebExtensions are allowed/possible to install. The only exceptions are Firefox Nightly, with the `xpinstall.signatures.required` preference[1] set to `false`, and the (as of this writing) current ESR release.[2]

With the current compatibility situation, we thus need to effectively support both Nightly *and* ESR in the addon, while trying to keep up with current/upcoming changes in `mozilla-central`. With old addons no longer being officially supported, the amount of old code being removed/refactored is now increasing quite quickly.

*Please note:* The changes proposed here was to a large extent prompted by bugs such as:
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1431533 (already landed)
 - https://bugzilla.mozilla.org/show_bug.cgi?id=767640 (already landed)
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1432992 (still open)

Upstreaming all of those changes for the `MOZCENTRAL` version of PDF.js, while also keeping the Firefox addon running in older versions of the browser, would quickly become non-trivial.
Since we're using the ruleset from `eslint-plugin-mozilla` for the addon files, which is enforced in `mozilla-central`, we must ensure that the neccessary changes are upstreamed to the PDF.js repo such that the `mozilla-central` version of PDF.js can still be updated without failures.

Trying to feature detect, for the `FIREFOX` build target, some of the changes in the referenced bugs would probably become both quite messy and (not to mention) difficult. E.g. with the upcoming and automatically defined `Cc, Ci, Cu, Cr` variables, any sort of feature detection might be tricky since those need to be defined in the global scope of the files in question.

Finally, given the amount of effort that we'd now need to spend to even attempt to keep the Firefox addon compatible, I just don't think it's worth the effort any more. Especially since the number of people that have, thus far, been doing this work is *very* low and those resources would be better spend elsewhere.
Unfortunately, this probably means that the development addon will no longer be compatible with release versions of Seamonkey. However the README has already mentioned, for quite some time, that support isn't guaranteed.

*In closing:* For all of the reasons mentioned above, I thus propose that we reduce the maintenance burden of the Firefox addon by only supporting the current Firefox Nightly.

---

[1] While the preference exists, and can be toggled, its value is ignored in non-Nightly versions of Firefox.

[2] There's unbranded builds of e.g. the release/beta versions of Firefox, where old and non-WebExtensions addons can be installed. However those builds can probably be assumed to be officially unsupported, and thus not recommended for users.
2018-02-04 14:07:17 +01:00
Rob Wu
7268f4ec1b [CRX] Add comment about ftp compatibility 2018-01-26 15:54:35 +01:00
Rob Wu
838573abd4 [CRX] Clean up file/ftp handler
Merge ftp and file handler now their implementations are identical.
Remove redundant comment (the referenced Chrome bug has been fixed
a long time ago - https://crbug.com/302548 ).
2018-01-26 15:54:35 +01:00
Rob Wu
85378fc982 [CRX] Remove feature-detect.js
All detected features were introduced in Chrome 35.
We don't support Chrome 34 and earlier, so drop the legacy code.
2018-01-26 15:54:35 +01:00
Jonas Jenwald
2db75a2a3a Update the ESLint dependencies, and also tweak the no-multiple-empty-lines rules
Since multiple empty lines is virtually unused in the code-base, and the few cases that do exist look like "typos", let's enforce greater consistency here; please see https://eslint.org/docs/rules/no-multiple-empty-lines.
2018-01-03 13:32:57 +01:00
Mark Banner
63c6157bdf Switch to using mozilla/recommended configuration for extensions/firefox. 2017-12-08 18:58:48 +00:00
Jonas Jenwald
b15de69c52 [Firefox addon] Temporarily disable the ESLint semi rule, around the DEFAULT_PREFERENCES declaration, to prevent mozilla-central test errors
While this doesn't actually fix the underlying issue, it should prevent the ESLint errors and thus make future PDF.js updates easier.
Compared to updating (and testing) the preprocessor, this seems like a reasonable workaround given its simplicity.
2017-12-05 20:52:39 +01:00
Mark Banner
3065197cc4 Update eslint-plugin-mozilla, and enable mozilla/use-services rule. 2017-11-24 16:58:36 +00:00
Brendan Dahl
61dd7d1c3a Accumulate streamed PDF data into array of buffers. 2017-11-08 20:32:29 -08:00
Doug Thayer
0f9f0f8a9b Cache PdfJs's enabled setting for delayed init
See Bug 1389443 for more information. This allows us to register
PdfJs without waiting for file IO in nsHandlerService to finish.
Once that file IO is finished, we can set everything up properly
and double-check the registration.
2017-08-22 12:20:58 -07:00
Jonas Jenwald
20d6286cce Add support for, the API property, PageMode in the viewer (issue 8657)
Note that the PageMode, as specified in the API, will only be honoured when either: the user hasn't set the `sidebarViewOnLoad` preference to a non-default value, or a non-default `sidebarView` entry doesn't exist in the view history, or the "pagemode" hash parameter is included in the URL.

Since this is new functionality, the patch also includes a preference (`disablePageMode`), to make it easy to opt-out of this functionality if the user/implementor so wishes.
2017-07-19 16:58:25 +02:00
Rob Wu
19549bb7d6 [CRX] Integrate cursorToolOnLoad pref + migration logic
Add UI for the cursorToolOnLoad pref in the UI of the Chrome extension.

Add logic to migrate the enableHandToolOnLoad pref to cursorToolOnLoad.
For past values in the mutable extension storage area:
1. If enableHandToolOnLoad=true, save cursorToolOnLoad=1.
2. Remove enableHandToolOnLoad.

For the managed extension storage, which is immutable since it is based
on administrative policies, use the following logic:
1. If enableHandToolOnLoad=true and cursorToolOnLoad=0 (default).
   set cursorToolOnLoad=0 and assume enableHandToolOnLoad=false.
2. As usual, managed preferences can (and will) be overridden by the user.

The first migration logic is in extensions/chromium/options/migration.js
and can be removed after a few months / less than many years.

The second migration logic is in web/chromecom.js, and should be kept
around for a long while (many years).

The need for this migration logic arises from the change by:
https://github.com/mozilla/pdf.js/pull/7635
2017-07-15 01:50:15 +02:00
Nimesh Solanki
e004b3cfab update inconsistent names 2017-07-11 00:57:39 +05:30
Brendan Dahl
5834ef6ff2 Bug 1353029 - Pass PdfJs.enabled into child on change. 2017-06-05 11:38:40 -07:00
Jonas Jenwald
4f48c8198c Fix inconsistent spacing and trailing commas in objects in extensions/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on
http://eslint.org/docs/rules/comma-dangle
http://eslint.org/docs/rules/object-curly-spacing

Given that we currently have quite inconsistent object formatting, fixing this in in one big patch probably wouldn't be feasible (since I cannot imagine anyone wanting to review that); hence I've opted to try and do this piecewise instead.

Please note: This patch was created automatically, using the ESLint `--fix` command line option. In a couple of places this caused lines to become too long, and I've fixed those manually; please refer to the interdiff below for the only hand-edits in this patch.

```diff
diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm
index ea91a71a..0d59dad1 100644
--- a/extensions/firefox/content/PdfStreamConverter.jsm
+++ b/extensions/firefox/content/PdfStreamConverter.jsm
@@ -773,7 +773,8 @@ class RequestListener {
         response = function sendResponse(aResponse) {
           try {
             var listener = doc.createEvent("CustomEvent");
-            let detail = Cu.cloneInto({ response: aResponse, }, doc.defaultView);
+            let detail = Cu.cloneInto({ response: aResponse, },
+                                      doc.defaultView);
             listener.initCustomEvent("pdf.js.response", true, false, detail);
             return message.dispatchEvent(listener);
           } catch (e) {
```
2017-06-01 13:25:24 +02:00
Yury Delendik
5438ce9b98 Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
Jonas Jenwald
36c2791296 Unify handling of various cursor tools, e.g. the current Hand Tool and a possible future Zoom Tool, in a new PDFCursorTools module
With the current way that the `HandTool` is implemented, if someone would try to also add a Zoom tool (as issue 1260 asks for) that probably wouldn't work very well given that you'd then have two cursor tools which may not play nice together.
Hence this patch, which attempts to refactor things so that it should be simpler to add e.g. a Zoom tool as well (given that that issue is marked as "good-beginner-bug", and I'm not sure if that really applies considering the current state of the code).

Note that I personally have no interest in implementing a Zoom tool (similar to Adobe Reader) since I wouldn't use it, but I figured that it can't hurt to make this code a bit more future proof.
2017-05-22 00:51:01 +02:00
Jonas Jenwald
cbba74f474 Revert "Upstream changes from: Bug 1319111 - Expose result principal URL ("final channel URL") on LoadInfo, convert current consumers of LOAD_REPLACE" 2017-05-18 12:08:05 +02:00
Mark Banner
2e9ae50a3a Use eslint-plugin-mozilla and the webextensions environment to avoid defining globals in each file. 2017-05-17 10:30:46 +01:00
Honza Bambas :mayhemer
20aa8d74e9 Upstream changes from: Bug 1319111 - Expose result principal URL ("final channel URL") on LoadInfo, convert current consumers of LOAD_REPLACE
This is a downstream change introduced in [1]. That mozilla bug is adding a new property to channel's loadinfo object (nsILoadInfo) that protocol handlers has to set on channels when originalURI on the result channel is set to a different URI than the channel has been created for.

Existence of the new property on nsILoadInfo depends on landing [1].

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1319111
2017-05-07 21:38:10 +02:00
Tim van der Meij
60c232bc8c Merge pull request #8353 from Snuffleupagus/eslint_object-shorthand
Enable the `object-shorthand` ESLint rule
2017-04-30 21:23:57 +02:00
Jonas Jenwald
8e976d7110 [Firefox addon] Replace a bind(this) statement with an arrow function in PdfStreamConverter.jsm (issue 8343)
Please note that I used the addon debugger to set a breakpoint in the `unload` function, in order to ensure that `this` still correctly refers to the `FindEventManager` scope.
2017-04-30 13:26:34 +02:00
Jonas Jenwald
7560f12a17 Enable the object-shorthand ESLint rule
Please see http://eslint.org/docs/rules/object-shorthand.

Unfortunately, based on commit 9276d1dcd9, it seems that we still need to maintain compatibility with old Node.js versions, hence certain files/directories that are executed in Node.js are currently exempt from this rule.

Furthermore, since the files specific to the Chromium extension are not run through Babel, the `/extensions/chromium/` directory is also exempt from this rule.
2017-04-30 11:13:34 +02:00
Jonas Jenwald
b3582ccbad Add the commit hash to the README.mozilla file (issue 8347) 2017-04-27 23:01:22 +02:00
Jonas Jenwald
3b59169ffc [Firefox addon] Upstream changes from: Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales
With [bug 1346616](https://bugzilla.mozilla.org/show_bug.cgi?id=1346616) and [this commit](https://hg.mozilla.org/mozilla-central/rev/39a903b099a6#l7.2), it's apparently no longer recommended to check the `general.useragent.locale` pref directly, but instead the `Services.locale.getRequestedLocale()` function should be used.

In this case, it's at least really easy to feature detect this properly :-)
2017-04-18 23:34:48 +02:00
Jonas Jenwald
cf87c9bba2 [Firefox addon] Upstream changes from: Bug 1356569 - Remove optional trailing parameters (issue 8310)
In https://bugzilla.mozilla.org/show_bug.cgi?id=1355216, the *third* parameter of `Services.obs.addObserver` was made optional.
However, omitting it in Firefox versions *without* that patch causes failures that completely prevents the addon from working (it won't even load).

As far as I can tell, there isn't *any* way to detect ahead of time if the third parameter can be safely omitted, hence we're forced to fallback to manually checking the version number :-(

*Note:* Since the `PdfJs.jsm` file is only used in the `MOZCENTRAL` build, we at least don't need to add any compatibility hacks there.
2017-04-18 20:51:17 +02:00
Tim van der Meij
e7a3ea29aa
Firefox extension: remove unused preference cleanup from bootstrap.js
The comment for the removal has been added three years ago, so we can
safely remove this now.
2017-04-14 23:49:01 +02:00
Georg Fritzsche
4e8cd2b7d3 Rename PdfJsTelemetry-addon.jsm to PdfJsTelemetry-stub.jsm
And remove unused linting comments.
2017-04-12 13:11:04 +02:00
Georg Fritzsche
788fe1f810 Stub out Firefox addon Telemetry wrapper
We are planning to remove the addon histogram APIs from Firefox
Telemetry.
The easy solution here is to just stub out all calls that use them.
2017-04-05 14:17:31 +07:00
Yury Delendik
a2ddf2f9ca Merge pull request #8218 from amccreight/no-sync
Split pdfjschildbootstrap.js to avoid sync IPC
2017-04-03 17:37:22 -05:00
Andrew McCreight
071951d787 Lazily load NetUtil.jsm in PdfStreamConverter.jsm.
This is one step towards not loading NetUtil.jsm at startup in a clean
profile.
2017-04-03 10:33:57 -07:00
Andrew McCreight
740e1ab450 Skip PdfJs.enabled check in bootstrap-enabled.
If we only invoke the bootstrap-enabled script when PdfJs.enabled is
true, then we don't need to check it again in the script.

This avoids a sync IPC call to the parent process.

It also keeps PdfJs.jsm from importing PdfjsContentUtils.jsm in the
child process until it is actually needed, which is one steps towards
not loading it until it is really needed.
2017-03-31 13:22:39 -07:00
Andrew McCreight
d804881151 Split bootstrap script.
pdfjschildbootstrap.js will always be run, but
pdfjschildbootstrap-enabled.js will only be run if PdfJs.enabled is
true. This will let us avoid some work in the child process in the
next patch.

This will need to be landed in the mozilla-central repository at the
same time as a change to nsBrowserGlue.js. See bug 1352218.
2017-03-31 13:22:39 -07:00
Yury Delendik
25873e92f0 Enable babel translation to enable ES module support. 2017-03-27 07:25:09 -05:00
Jonas Jenwald
ebae24cacc Upstream the changes from bug 1345294 - nsIPrefBranch should have methods to get/set unicode strings
Note that in order to not break compatibility for the Firefox addon, the preprocessor is used.

Re: [bug 1345294](https://bugzilla.mozilla.org/show_bug.cgi?id=1345294) and also [this commit](https://hg.mozilla.org/mozilla-central/rev/5a8192a650e9).
2017-03-20 07:36:36 +01:00
Jonas Jenwald
a7c19d9cbb Adjust the yoda ESLint rule to apply to inequalities as well
I happened to notice that some inequalities had the wrong order, and was surprised since I thought that the `yoda` rule should have caught that.
However, reading http://eslint.org/docs/rules/yoda#options a bit more closely than previously, it's quite obvious that the `onlyEquality` option does *exactly* what its name suggests. Hence I think that it makes sense to adjust the options such that only ranges are allowed instead.
2017-03-19 13:27:14 +01:00
Tim van der Meij
cf73f4bc2d Merge pull request #8024 from Rob--W/issue-6643-pdf-attachment-in-pdfjs
Open PDF attachments in the viewer instead of an unconditional download
2017-02-18 21:52:29 +01:00
Tim van der Meij
573236e3ad Merge pull request #8043 from Rob--W/issue6696-auto-rotate-page
Allow automatic print rotation via the enablePrintAutoRotate preference
2017-02-08 23:57:28 +01:00
Rob Wu
ece44d36e8 Allow automatic print rotation via enablePrintAutoRotate 2017-02-08 12:39:24 +01:00
Jonas Jenwald
b898a453f0 [Firefox addon] Remove the unused MOZ_CENTRAL constant
The last (and only) usage of `MOZ_CENTRAL` was removed in PR 3036, so it's been unused for almost four years now.
If we need to have different code-paths for `FIREFOX`/`MOZCENTRAL` builds, the preprocessor should (and has) been used instead.
2017-02-04 17:51:40 +01:00
Rob Wu
d9f90d595d [CRX] Recognize blob and data-URLs in the router
When a blob or data-URL is opened with the extension, viewer.html
rewrites the URL. But when the viewer is refreshed (e.g. F5), Chrome
would fail to display the viewer because the extension router was not
set up to recognize such URLs.

Now it is.
2017-02-04 01:20:17 +01:00
Jonas Jenwald
7e1d92461a [Firefox addon] Enable the consistent-return ESLint rule (issue 7957)
See http://eslint.org/docs/rules/consistent-return; it appears that I overlooked this rule in PR 7982.

Also adds the http://eslint.org/docs/rules/no-nested-ternary rule, which didn't require any code changes, since that rule is being enforced in mozilla-central.

Re: issue 7957.
2017-01-27 19:04:08 +01:00
Jonas Jenwald
a5d5b970af [Firefox addon] Enforce double quotes, using ESLint, to avoid linting errors in mozilla-central (issue 7957)
Given that this patch causes a lot of churn in the addon code, I wouldn't really mind if we ultimately decide against doing this and just add a rule exception in mozilla-central instead.[1]

---
[1] Note that I used the ESLint `--fix` option, hence writing this commit message actually took longer time than the creation of the patch :-)
2017-01-25 01:14:06 +01:00
Jonas Jenwald
f000417ce0 [Firefox addon] Stop bundling src/core/network.js into the FIREFOX/MOZCENTRAL builds (PR 7322 follow-up)
PR 7322 added the `PdfJsNetwork.jsm` file, instead of the general `src/core/network.js` file for the Firefox addon. However, `make.js` wasn't updated to actually stop including the now obsolete network file.
2017-01-23 22:23:17 +01:00
Jonas Jenwald
3ec99f0e12 [Firefox addon] Convert the code to be ES6 friendly, in order to better agree with mozilla-central coding conventions (issue 7957)
*Please note: ignoring whitespace changes is most likely necessary for the diff to be readable.*

This patch addresses all the current, in `mozilla-central`, linting failures in the addon. It should thus be possible to change the `.eslintignore` entry for PDF.js in `mozilla-central` from `browser/extensions/pdfjs/**` to `browser/extensions/pdfjs/build/**` and `browser/extensions/pdfjs/web/**` instead.
Note that we cannot, for backwards compatibility reason of the general PDF.js library, at this time make similar changes for files residing in the `build` and `web` directories in `mozilla-central`.

The main changes in this patch are that we now use [classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) instead of our previous "class-like" functions, and also use the more compact [object shorthand notation](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015).
A couple of functions were also converted to [arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions), to reduced usages of `bind(this)` and `var self = this`.

One caveat with ES6 classes is that it's not (yet) possible to define private constants/helper functions within them, which is why the `NetworkManagerClosure` was kept to not change the visibility of those constant/functions.

Besides testing in Firefox Nightly 53, this patch has also been tested in Firefox ESR 45 and SeaMonkey 2.46.
However, I'd gladly welcome help with testing the patch more, to ensure that nothing has gone wrong during the refactoring.

Fixes the first bullet point of issue 7957.
2017-01-22 23:14:58 +01:00
Jonas Jenwald
0dff8f3600 Adjust the space-unary-ops ESLint rule to comply with mozilla-central lint rules
See http://eslint.org/docs/rules/space-unary-ops; a *very* small part of issue 7957.
2017-01-16 17:19:25 +01:00
Jonas Jenwald
54a64863e2 [Bug 1330147] removeObserver calls should not supply a third parameter
*This is yet another very recent change that we were not notified about.*

Upstream changes from https://bugzilla.mozilla.org/show_bug.cgi?id=1330147, specifically https://hg.mozilla.org/mozilla-central/rev/8e0b7bc5fd71.
2017-01-13 11:34:26 +01:00
Yury Delendik
1f424e561d [Bug 1329182] remove trailing newURI null parameters 2017-01-12 19:40:51 -06:00
Yury Delendik
b8cd14336e Merge pull request #7913 from Snuffleupagus/addon-minimum-firefox45
[Firefox addon] Change the minimum supported version to Firefox 45, i.e. the current ESR version, and remove no longer necessary fallback code
2017-01-12 15:12:27 -06:00
Jonas Jenwald
4046d67fde Enable the no-else-return ESLint rule
Using `else` after `return` is not necessary, and can often lead to unnecessarily cluttered code. By using the `no-else-return` rule in ESLint we can avoid this pattern, see http://eslint.org/docs/rules/no-else-return.
2017-01-09 20:27:39 +01:00
Jonas Jenwald
15f75a5585 [Firefox addon] Remove the registerAddonHistogram fallback code for Firefox versions 36 (and below) from PdfJsTelemetry-addon.jsm
Given that the addon doesn't even work in Firefox versions prior to 38, this is just dead code that can now be removed.
2017-01-07 12:19:42 +01:00
Jonas Jenwald
9434c023ab [Firefox addon] Change the minimum supported version to Firefox 45, i.e. the current ESR version, and remove no longer necessary fallback code
According to https://wiki.mozilla.org/RapidRelease/Calendar#Past_branch_dates: The *last* ESR version of Firefox 38 was released in April this year, and since June the only available ESR version has been based on Firefox 45.

Now that Seamonkey has *finally* released a new version, i.e. 2.46 which should correspond to Firefox 49, there doesn't seem to be any reason to keep the fallback code around in the addon anymore.
2017-01-07 12:19:42 +01:00
Jonas Jenwald
c850968fa7 Remove globals that are now unnecessary thanks to the use of various ESLint environments (e.g. Node, ShellJS, Jasmine) 2016-12-16 21:09:55 +01:00
Jonas Jenwald
2f3805efbc Switch to using ESLint, instead of JSHint, for linting
*Please note that most of the necessary code adjustments were made in PR 7890.*

ESLint has a number of advantageous properties, compared to JSHint. Among those are:
 - The ability to find subtle bugs, thanks to more rules (e.g. PR 7881).
 - Much more customizable in general, and many rules allow fine-tuned behaviour rather than the just the on/off rules in JSHint.
 - Many more rules that can help developers avoid bugs, and a lot of rules that can be used to enforce a consistent coding style. The latter should be particularily useful for new contributors (and reduce the amount of stylistic review comments necessary).
 - The ability to easily specify exactly what rules to use/not to use, as opposed to JSHint which has a default set. *Note:* in future JSHint version some of the rules we depend on will be removed, according to warnings in http://jshint.com/docs/options/, so we wouldn't be able to update without losing lint coverage.
 - More easily disable one, or more, rules temporarily. In JSHint this requires using a numeric code, which isn't very user friendly, whereas in ESLint the rule name is simply used instead.

By default there's no rules enabled in ESLint, but there are some default rule sets available. However, to prevent linting failures if we update ESLint in the future, it seemed easier to just explicitly specify what rules we want.
Obviously this makes the ESLint config file somewhat bigger than the old JSHint config file, but given how rarely that one has been updated over the years I don't think that matters too much.

I've tried, to the best of my ability, to ensure that we enable the same rules for ESLint that we had for JSHint. Furthermore, I've also enabled a number of rules that seemed to make sense, both to catch possible errors *and* various style guide violations.

Despite the ESLint README claiming that it's slower that JSHint, https://github.com/eslint/eslint#how-does-eslint-performance-compare-to-jshint, locally this patch actually reduces the runtime for `gulp` lint (by approximately 20-25%).

A couple of stylistic rules that would have been nice to enable, but where our code currently differs to much to make it feasible:
 - `comma-dangle`, controls trailing commas in Objects and Arrays (among others).
 - `object-curly-spacing`, controls spacing inside of Objects.
 - `spaced-comment`, used to enforce spaces after `//` and `/*. (This is made difficult by the fact that there's still some usage of the old preprocessor left.)

Rules that I indend to look into possibly enabling in follow-ups, if it seems to make sense: `no-else-return`, `no-lonely-if`, `brace-style` with the `allowSingleLine` parameter removed.

Useful links:
 - http://eslint.org/docs/user-guide/configuring
 - http://eslint.org/docs/rules/
2016-12-16 21:06:36 +01:00
Jonas Jenwald
28e50cfa21 Fix errors reported by the space-infix-ops ESLint rule
http://eslint.org/docs/rules/space-infix-ops
2016-12-12 20:36:00 +01:00
Jonas Jenwald
aae27e76bb Fix errors reported by the no-multiple-empty-lines ESLint rule
http://eslint.org/docs/rules/no-multiple-empty-lines
2016-12-12 20:35:58 +01:00
Jonas Jenwald
ad915f8af1 Fix errors reported by the comma-spacing ESLint rule
http://eslint.org/docs/rules/comma-spacing
2016-12-12 20:35:53 +01:00
Yury Delendik
f7d6f3a739 Adds SVG rendering capabilities to the PDFViewer. 2016-11-18 13:03:49 -06:00
Yury Delendik
a4402c84de Refactor toolbar (and secondary toolbar). 2016-11-18 12:51:15 -06:00
Jonas Jenwald
f461fd64aa Add support for PageLabels in the viewer
This patch implements the page label functionality in a similar way as Adobe Reader.
For documents with page labels, if a non-existent page label is entered we'll try to fallback to the page number instead.
The patch also includes a preference (`disablePageLabels`), to make it easy to opt-out of using page labels if the user/implementor so wishes.

The way that `get/set currentPageLabel` is implemented in `PDFViewer`, is as wrappers for the corresponding `get/set currentPageNumber` functions, since that seemed like the cleanest solution.
The page labels are purposely *only* added to the page controls in the viewer UI, and not stored in e.g. the `ViewHistory`. Since doing so would mean adding unnecessary code complexity, without any real added value, and would also mean delaying the inital loading of PDF documents.

Note that this patch will ignore page labels if they are identical to standard page numbering, since in this case displaying the page labels adds no value (but only UI noise). The reason for handling this case specially, is that in practice a surprising number of PDF files include "pointless" page labels.
2016-10-26 13:30:36 +02:00
Yury Delendik
0576c9c6c6 Replaces all preprocessor directives with PDFJSDev calls. 2016-10-14 10:57:53 -05:00
Rob Wu
ae74e1bbd6 Deduct file type from content-disposition
A user encountered a response that looks like:

URL: some gibberish
Headers:

    Content-Type: application/octet-stream
    Content-Disposition: attachment; filename="something.pdf"

In the Chrome extension, the "attachment" content disposition is almost
always ignored (i.e. the PDF Viewer will try to view it anyway). So we
need to fall back to the Content-Disposition header if the URL check is
inconclusive.
2016-09-17 22:34:18 -07:00
Yury Delendik
503bf45eca Drops unneeded HTTP refresh header for the extension.
Some sites doing that by mistake. Aligning the extension functionality with behavior of other browsers/plugins..
2016-09-15 09:12:16 -05:00
Jonas Jenwald
e12c48b73f Add a enhanceTextSelection preference
Please note that this is a hack, but I think that it should be OK for now to atleast get the preference landed. Refer to the code comment for further information.

Re: issue 7584 and PR 7586.
2016-09-08 10:22:01 +02:00
Tim van der Meij
e686db250c Render interactive form (AcroForm) text widget annotations
This patch is the first step towards implementing support for
interactive forms (AcroForms). It makes it possible to render text
widget annotations exactly like Adobe Reader/Acrobat.

Everything we implement for AcroForms is disabled by default using a
preference, mainly because it is not ready to use yet, but has to
implemented in many steps to avoid complexity. The preference allows us
to work with the code while not exposing the behavior by default. Mainly
storing entered values and printing them is still absent, which would be
minimal requirements for enabling this by default.
2016-09-07 15:37:28 +02:00
Tim van der Meij
a2525a8ba3 Revert "Add a enhanceTextSelection preference to the viewer"
This reverts commit 15e45d772f.
2016-09-03 20:26:46 +02:00
Jonas Jenwald
15e45d772f Add a enhanceTextSelection preference to the viewer 2016-09-02 14:38:51 +02:00
Brendan Dahl
815c3a822f Bug 1291709 - PdfjsChromeUtils.jsm leaks browser.xul windows. 2016-08-03 14:18:40 -07:00
Tim van der Meij
a9dd2ab0ab Move B2G viewer to the examples folder 2016-07-27 17:31:52 +02:00
Tim van der Meij
e65606d271 Remove previousPageNumber from the B2G viewer 2016-07-27 15:55:40 +02:00
klemens
6f03f62327 trivial spelling fixes 2016-07-17 14:33:41 +02:00
Peter Dave Hello
625d637297 optimize png images using zopflipng 2016-07-10 17:49:16 +08:00
Jonas Jenwald
87229a086f Update mxr.mozilla.org links to point to dxr.mozilla.org instead
Given that MXR has been officially retired, see https://groups.google.com/forum/#!topic/mozilla.dev.platform/_k-ditFrne4, we've got a couple of links that are no longer working.
2016-07-06 11:42:16 +02:00
Yury Delendik
3cba2cb258 Fixes SeaMonkey version 2016-06-29 17:54:11 -05:00
Jonas Jenwald
9fbde18880 [Firefox addon] Feature detect originAttributes to make it Seamonkey 2.40 compatible
Fixes 7245.
2016-06-24 17:05:53 +02:00
Jonas Jenwald
6d7f6f1b86 Upstream the changes from Bug 1242730 - Convert callsites to use channel.async0pen2() within browser/extensions/pdfjs (issue 7386)
Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1242730.

Fixes 7386.
2016-06-15 14:50:56 +02:00
Jonas Jenwald
d3d3bb9695 [Firefox addon] Change the minimum supported version to Firefox 38 and remove a bunch old no longer necessary fallback code
From the discussion in issue 7386, it wasn't really clear if we can restrict addon support to Firefox `45` (i.e. the version that corresponds to the *current* ESR version).

However, we have a bunch of code for *very* old Firefox versions. Hence this patch changes the minimum supported version to Firefox `38` (which was released on `2015-05-12`, and correspond to the *previous* ESR version), and removes code that only applies to old Firefox versions.

Regardless what we end up deciding regarding addon support for previous Firefox versions, given the amount of code that even the Firefox `>= 38` condition lets us remove, I certainly think that there is value in doing this.
2016-06-15 09:54:41 +02:00
Rob Wu
08ad551a01 Force inline block display style for <object>.
Test:
1. Build the Chrome extension and load it.
2. Visit https://robwu.nl/pdfjs/object-embed.html
3. Verify that all displayed blocks have the same width and
   height as the reference ("Expected dimension").
2016-06-11 15:54:16 +02:00
Rob Wu
60438399e0 Fix typo in telemetry.js, follow-up to #7370 2016-06-03 23:28:01 +02:00
Rob Wu
724308c57a Add opt-out telemetry to the Chrome extension
Privacy policy: https://github.com/Rob--W/pdfjs-telemetry#privacy-policy

Unit tests (offline):

```
node test/chromium/test-telemetry.js
```

Server tests (requires that Nginx is installed):

```
git clone https://github.com/Rob--W/pdfjs-telemetry.git
cd pdfjs-telemetry/
python testserver.py TestHttp TestHttps
```

Integration test (extension + server):

- Build the extension
- Edit build/chromium/telemetry.js and remove the check for
  chrome.runtime.id.
- Start Chrome (preferably a new profile):
  chromium --user-data-dir=/tmp/pdftest --no-first-run
- Open chrome://net-internals#events
- Visit chrome://extensions and enable Developer mode.
- Load unpacked extension, select build/chromium.
- Go to the chrome://net-internals tab and filter on pdfjs.robwu.nl.
- Click on URL_REQUEST and verify that the server replied with 204.
- Reload the extension.
- Verify that chrome://net-internals did not contain a new log request.
2016-06-03 20:36:57 +02:00
Rob Wu
0be8e72d6f Support syncing of settings in Chrome extension
Use chrome.storage.sync to store preferences instead of
chrome.storage.local, to allow settings to be synchronized if the user
chooses to sign in in Chrome and enables synchronization of extension
preferences.
2016-05-25 00:51:51 +02:00
Tim van der Meij
fdfaa43f5e Resolve a regression in the Chromium extension's preferences handling
Commit df10513e10 unfortunately broke the options dialog of the Chromium extension because the logic required to work with the preference was not added. This patch adds the required logic to show the preference in the options dialog and to persist it to the preferences storage.

Verified using Chromium 50 on Arch Linux.
2016-05-25 00:32:32 +02:00
Tim van der Meij
6316ca0299 Merge pull request #7344 from Rob--W/crx-cleanup-compat-frame
Remove support for frames in old Chromium versions
2016-05-25 00:04:45 +02:00
Yury Delendik
df10513e10 Moves DEFAULT_PREFENCES into JSON format. 2016-05-11 17:58:17 -05:00
Rob Wu
9394fc133c Remove support for frames in old Chromium versions
Frames are only supported (via redirectUrl) in Chrome 35.0.1911.0+
2016-05-10 22:40:07 +02:00
Tim van der Meij
8dcc727be1 Merge pull request #7244 from Rob--W/crx-pdf-embed-object-no-shadow-dom
Don't use shadow DOM for rendering <object>/<embed>
2016-05-09 23:59:28 +02:00
Rob Wu
fc658a718c Remove streamsPrivate usage
This was only ever useful for the Opera extension because the API
requires a whitelisted extension ID. Opera ditched PDF.js from their
extension gallery, so we don't need to keep this in the tree.
2016-05-09 22:49:47 +02:00
Yury Delendik
148102b626 Refactors firefoxcom dependency on app and l10n. 2016-04-24 08:25:55 -05:00
Rob Wu
b45e6a7cc9 Don't use shadow DOM for rendering <object>/<embed>
Multiple shadow roots are not supported any more in Chrome 51+
(https://crbug.com/603448#c6), so this patch changes the way that PDFs
are rendered in `<embed>` / `<object>` tags.

I used shadow roots because their content is not visible from the web
page, so the odds of conflicts were minimal. Now I have to render the
PDF frame directly in the page, which can be observed from the page
(unfortunately).

Now the following happens when an embedded PDF tag is detected:

- `<embed>` tags: The type and src attributes are updated.
- `<object>` tags: The type attribute is changed and the fallback
  content is set and displayed.
2016-04-23 23:52:22 +02:00
Dave Huseby
867a5ea1b0 Make pdf.js use the correct principal origin attributes when loading subresources. 2016-04-04 14:12:51 -07:00
Yury Delendik
2b246192e1 Removes frontWindow usage from the stream converter. 2016-03-24 11:47:34 -05:00
Jonas Jenwald
41efb92d3a Merge pull request #6988 from timvandermeij/fileattachment-annotation
Implement support for FileAttachment annotations
2016-02-24 12:58:06 +01:00
Tim van der Meij
0351c7eff4 Move the getFileName helper function to the core
This is required to be able to use it in the annotation display code,
where we now apply it to sanitize the filename of the FileAttachment
annotation. The PDF file from https://bugzilla.mozilla.org/show_bug.cgi?id=1230933 has shown that some PDF generators include the path of the file rather than the filename, which causes filenames with weird initial characters. PDF viewers handle this differently (for example Foxit Reader just replaces forward slashes with spaces), but we think it's better to only show the filename as intended.

Additionally we add unit tests for the `getFilenameFromUrl` helper
function.
2016-02-23 22:49:53 +01:00
Tim van der Meij
6a33dfd13a Implement support for FileAttachment annotations 2016-02-23 22:49:53 +01:00
Jonas Jenwald
f64113c927 [Addon] Catch errors in getFindBar (in PdfStreamConverter.jsm) to fix loading of PDF files in the bookmark sidebar (bug 1248959)
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1248959.
2016-02-18 13:59:18 +01:00
Yury Delendik
2f145d8db4 Republish addon 2016-02-11 15:36:32 -06:00
Yury Delendik
2addcc7957 Republish addon 2016-02-11 15:21:15 -06:00
Rob Wu
0ec82d4a50 Allow local PDF files to be viewed in local frames
The Chrome extension enforces that local files cannot be embedded in
non-local web pages. The previous check was too strict (because the
origin of a file:-URL is "null"), and prevented local PDF from being
viewed in local files).

This patch fixes that problem, by querying the actual tab URL via the
background page.

Steps to verify:
1. Create a HTML file: `<iframe src=test.pdf width=100% height=100%>`
2. Build and load the extension.
3. Allow file access to the extension at `chrome://extensions`
4. Open the HTML file from a file:// URL.
5. VERIFY: The extension should attempt to load the PDF file.

6. Now open the following (replace ID with the extension ID, which you
   can find at `chrome://extensions`):
  `data:text/html,<iframe src="chrome-extension://ID/file:///test.pdf">`
7. VERIFY: The next error should be displayed:
   "Refused to load a local file in a non-local page for security reasons."
2016-02-10 14:52:54 +01:00
Yury Delendik
49437c879d Republish the extension. 2015-12-18 10:33:12 -06:00
Yury Delendik
479d96eb24 Testing ability to auto-upgrade the addons. 2015-12-18 10:05:20 -06:00
Yury Delendik
e7311cdc6e Fixes versions in update.rdf. 2015-12-18 09:44:18 -06:00
Yury Delendik
d98105fdbd Fixes update extension github link. 2015-12-18 09:32:46 -06:00
Yury Delendik
2fb9baf6f1 Changing Firefox Addon ID
.. to allow AMO publishing to the unlisted extensions for automatic signing.
2015-12-18 09:06:23 -06:00
Manas
a2ba1b8189 Uses editorconfig to maintain consistent coding styles
Removes the following as they unnecessary
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
2015-11-14 07:32:18 +05:30
Yury Delendik
c8c211602b Merge pull request #6073 from Snuffleupagus/bug-1170063
[Firefox] Handle the user modifying the "mousewheel.with_meta.action" and "mousewheel.with_control.action" prefs (bug 1170063)
2015-10-30 11:54:04 -05:00
Yury Delendik
59c13b32aa Adds destroy method to the document loading task.
Also renames PDFPageProxy.destroy method to cleanup.
2015-10-23 08:57:14 -05:00
Jonas Jenwald
49389c2d30 Follow-up to PR 6489 - Upstream changes from Bug 1202902
I somehow managed miss including one of the upstream changes in PR 6489; hence this patch. Sorry about the unnecessary churn in this code!
2015-10-05 12:31:53 +02:00
Yury Delendik
82f73dfed5 Merge pull request #6473 from Snuffleupagus/bug-1165272
Upstream the changes from Bug 1165272 - unify Get*CodebasePrincipal with createCodebasePrincipal in nsIScriptSecurityManager
2015-10-01 11:47:12 -05:00
Jonas Jenwald
26ec36ba4c Upstream changes from Bug 1202902 - Give loader scripts and XUL frame scripts a lexical scope that doesn't break everything?
One of the patches in https://bugzilla.mozilla.org/show_bug.cgi?id=1202902, specifically [`Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff)`](https://hg.mozilla.org/mozilla-central/rev/380817d573cd), touches PDF.js code. Unfortunately it was landed upstream without, as far as I can tell, notifying us about it.

This patch uplifts the relevant changes to avoid future merge conflicts, and for consistency also tweaks `PdfJs-stub.jsm`.
2015-10-01 10:03:10 +02:00
Jonas Jenwald
0be1f449ee Upstream the changes from Bug 1165272 - unify Get*CodebasePrincipal with createCodebasePrincipal in nsIScriptSecurityManager
One of the patches in https://bugzilla.mozilla.org/show_bug.cgi?id=1165272, specifically https://hg.mozilla.org/mozilla-central/rev/5a29e8bc51ca, touches PDF.js code. Unfortunately it was landed upstream without, as far as I can tell, notifying us about it.
This patch uplifts the relevant changes, and also adds preprocessor tags to avoid including unnecessary code in mozilla-central.
2015-09-24 18:25:27 +02:00
Jonas Jenwald
421289c7bc Merge pull request #6233 from Rob--W/crx-local-files
Improve support for viewing PDFs from file://-URLs in the Chrome extension
2015-08-15 14:15:36 +02:00
Rob Wu
32e7a8adba Don't reload after updating if a tab is in use 2015-08-14 19:00:12 +02:00
Rob Wu
4ac8863e30 Restore extension tab after reload
Work-around for https://crbug.com/511670
2015-08-14 19:00:12 +02:00
Rob Wu
775d4e69cf Teach users how to enable access to local files. 2015-08-14 18:59:30 +02:00
Yury Delendik
4f3f983a21 Removes PdfRedirector.js and PlayPreview support. 2015-08-06 10:38:45 -05:00
Tim van der Meij
91ab010829 Merge pull request #6201 from Rob--W/crx-dont-force-no-download
[CRX] Respect download requests in main frame
2015-07-18 15:05:32 +02:00
Yury Delendik
eb2ad11571 Merge pull request #5918 from Snuffleupagus/remove-fallback-cpow
[Firefox] Replace the CPOW with asynchronous messages for the Fallback bar
2015-07-06 21:31:48 -05:00
Jonas Jenwald
5aaf18db12 Merge pull request #6169 from yurydelendik/rm-playpreview
Bug 1179262 - Remove PlayPreview registration from PDF Viewer.
2015-07-06 17:32:29 +02:00
Rob Wu
ffbe669730 [CRX] Respect download requests in main frame
When the URL contains "=download", respect the Content-Disposition
header in the Chrome extension.
2015-07-06 17:13:44 +02:00
Rob Wu
4367dd5130 [CRX] Ignore PDFs from responses to POST requests
As explained in
https://github.com/mozilla/pdf.js/issues/6174#issuecomment-118502802.

To verify that this patch works:
1. Build the Chrome extension (node make chromium)
2. Load the Chrome extension (at chrome://extensions)
3. Visit https://robwu.nl/pdfjs/issue6174/.
4. Verify that PDF.js is not used to load the PDF. Either Chrome's
   default PDF Viewer is used, or the PDF is offered as a file download.
2015-07-05 01:01:03 +02:00
Yury Delendik
0b5330781c Bug 1179262 - Remove PlayPreview registration from PDF Viewer. 2015-07-02 12:59:17 -05:00
Yury Delendik
1b847df2f3 Using pdfjs-dist as a library for b2g viewer. 2015-06-30 16:53:32 -05:00
Jonas Jenwald
633d51fc22 [Firefox] Handle the user modifying the "mousewheel.with_meta.action" and "mousewheel.with_control.action" prefs (bug 1170063)
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1170063.

The bug only mentions the <kbd>Meta</kbd> key, but given that a similar situation can occur for <kbd>Ctrl</kbd>, it seemed reasonable to also handle that case in the same patch.

The only possible caveat with the patch is that because of the use of `shadow`, things won't work perfectly if either of the prefs are changed *while* the viewer is active. In this case a reload is required in order for it to work correctly, but given that the issue this patch fixes should be quite rare anyway, that seems OK.
2015-06-19 14:57:32 +02:00
Jonas Jenwald
591a3c291f Make FirefoxCom.requestSync able to return objects from PdfStreamConverter.jsm, by utilizing makeContentReadable 2015-06-19 14:39:18 +02:00
Rob Wu
adb2f8ae21 [CRX] Add Referer request header if needed
This patch adds the Referer request header to PDF requests if
the original PDF request included the Referer header.
2015-06-05 23:24:40 +02:00
Yury Delendik
c7756d5f96 Merge pull request #6051 from Snuffleupagus/esr-31-find
[Firefox] Re-add _getTabForBrowser compatibility hack for the addon
2015-05-27 08:15:25 -05:00
Jonas Jenwald
5743b4f558 [Firefox] Fix newChannel/asyncFetch fallout from bug 1167053
For some reason, https://bugzilla.mozilla.org/show_bug.cgi?id=1167053 changed methods of `NetUtil` yet *again*. This patch thus attempts to handle those changes, while keeping the addon backwards compatible.

I've tested this using all current Firefox versions (Nightly, Aurora/DevEdition, Beta, Release, ESR), and things still appears to work correctly.
2015-05-27 13:43:17 +02:00
Jonas Jenwald
c82fa16dd2 [Firefox] Re-add _getTabForBrowser compatibility hack for the addon
This should enable Find to work again in the current ESR version (31).
2015-05-26 18:12:17 +02:00
Jonas Jenwald
93a65921da [Firefox] Replace the CPOW with asynchronous messages for the Fallback bar
This patch removes the only remaining CPOW usage from the code-base, and should thus fix https://bugzilla.mozilla.org/show_bug.cgi?id=1071082.

*Note:* This will not fix the "Open With Different Viewer" button in e10s, since clicking it still fails with `frontWindow is null` in the console, but I do believe that that issue is somewhat orthogonal to the current patch.
2015-04-26 11:59:05 +02:00
Jonas Jenwald
9f63fa4b07 Address review comments from Bug 1148192 - Update pdf.js to version 1.1.24
See https://bugzilla.mozilla.org/show_bug.cgi?id=1148192#c3.
2015-04-06 16:26:23 +02:00
Jonas Jenwald
b721e902dc Remove unused |getChromeWindow| function from PdfStreamConverter.jsm 2015-03-24 18:58:20 +01:00
Jonas Jenwald
133cfc78fa Remove obsolete CPOW code from PdfjsContentUtils.jsm (PR 5749 followup)
This code is unused since PR 5749, and according to https://github.com/mozilla/pdf.js/pull/5749#discussion_r25931841 it should be removed.
2015-03-24 18:36:05 +01:00
Yury Delendik
5cbb5004a3 Merge pull request #5749 from krizsa/removeCPOWs
Bug 1072350 - Removing CPOWs used by Find events.
2015-03-24 11:59:06 -05:00
Yury Delendik
ed243cf02f Using newChannel2 instead of newChannel in the extension. 2015-03-09 19:40:19 -05:00
Gabor Krizsanits
595be5cb4f Bug 1072350 - Removing CPOWs used by Find events. 2015-03-08 17:21:06 +01:00
Collin Anderson
54e984c763 cleaned whitespace 2015-02-17 11:07:37 -05:00
Jonas Jenwald
801902c6cc Fix lint error: extensions/firefox/content/PdfStreamConverter.jsm: line 384, col 63, Expected '===' and instead saw '=='. 2015-01-22 20:58:04 +01:00