Commit Graph

536 Commits

Author SHA1 Message Date
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
Jonas Jenwald
8389f1d792 Merge pull request #5511 from gijsk/patch-1
Bug 639134 - update check for document colors
2015-01-22 20:43:50 +01:00
Rob Wu
1b043bfd5a Chrome extension: Add options page 2015-01-14 00:01:29 +01:00
Gijs
1d674d3e8f Bug 639134 - update check for document colors
This checks for both prefs on the understanding that we need to work on older versions of Firefox. If that isn't the case, the first part of the if isn't necessary. This should only land if bug 639134 is resolved - I'd make the patch part of that bug, but AIUI pdfjs's canonical repo is on github, so...
2014-11-26 23:25:03 +00:00
Jonas Jenwald
4da57c3b85 Fix code style in extensions/firefox/content/PdfStreamConverter.jsm 2014-11-06 23:49:51 +01:00
Jonas Jenwald
8921606b68 Fix code style in extensions/firefox/content/PdfJsTelemetry-addon.jsm 2014-11-06 23:49:50 +01:00
Jonas Jenwald
80503e4197 Fix code style in extensions/firefox/content/PdfJsTelemetry.jsm 2014-11-06 23:37:34 +01:00
Jonas Jenwald
ac0f48c2fc Fix code style in extensions/firefox/content/PdfJs-stub.jsm 2014-11-06 23:37:34 +01:00
Jonas Jenwald
c4c5c2222b Fix code style in extensions/firefox/content/PdfjsContentUtils.jsm 2014-11-06 23:37:33 +01:00
Jonas Jenwald
3370b18e0b Fix code style in extensions/firefox/content/PdfjsChromeUtils.jsm 2014-11-06 23:37:33 +01:00
Jonas Jenwald
9ed3e1e545 Fix code style in extensions/firefox/content/PdfJs.jsm 2014-11-06 23:37:32 +01:00
Brendan Dahl
1480850045 Merge pull request #5428 from yurydelendik/regaddon
Bug 1076909 - change args order in registerAddonHistogram.
2014-11-06 14:34:51 -08:00
Yury Delendik
4d4ef11978 Bug 1076909 - change args order in registerAddonHistogram. 2014-11-06 15:27:28 -06:00
araghava
e2c001c19d [issue 5440] fix rtl direction bug for full language codes 2014-10-26 17:16:56 -04:00
Brendan Dahl
8445ff1e45 Merge pull request #5402 from yurydelendik/streammem
Refactors PdfDataLister buffering.
2014-10-13 14:26:50 -07:00
Yury Delendik
63444aa4b3 Refactors PdfDataLister buffering. 2014-10-13 15:27:05 -05:00
Yury Delendik
55957a7d30 Merge pull request #5395 from Snuffleupagus/getTabForBrowser
[Firefox] Use getTabForBrowser instead of _getTabForBrowser if possible
2014-10-13 09:16:36 -05:00
Jim Mathies
fc3721ce2d Bug 1071709 - 5-30% TART / Session Restore regressions on Inbound (v.35) september 22 from rev d3a7f765152f 2014-10-10 23:04:49 +02:00
Jonas Jenwald
a34e7aa8fe [Firefox] Use getTabForBrowser instead of _getTabForBrowser if possible 2014-10-10 22:26:52 +02:00
Yury Delendik
56d11fc26b Merge pull request #5364 from Rob--W/firefox-pbu_isWindowPrivate
Firefox addon: Use isContentWindowPrivate instead of isWindowPrivate if available
2014-10-01 17:05:23 -05:00
Rob Wu
4fe92f6d01 addon: isWindowPrivate -> isContentWindowPrivate
As of Firefox 35, isContentWindowPrivate should be used for DOM windows instead of isWindowPrivate.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1069059 and
http://hg.mozilla.org/mozilla-central/diff/324798b60ba3/toolkit/modules/PrivateBrowsingUtils.jsm

Without this fix, you will get the following error message when Firefox+PDF.js is started:
>
WARNING: content window passed to PrivateBrowsingUtils.isWindowPrivate. Use isContentWindowPrivate instead (but only for frame scripts).
pbu_isWindowPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:25:14
ChromeActions.prototype.isInPrivateBrowsing@resource://pdf.js/PdfStreamConverter.jsm:237:12
xhr_onreadystatechange@resource://pdf.js/PdfStreamConverter.jsm:545:30
NetworkManager_requestRange@resource://pdf.js/network.js:95:7
NetworkManager_requestRange@resource://pdf.js/network.js:81:14
RangedChromeActions_requestDataRange@resource://pdf.js/PdfStreamConverter.jsm:596:1
RequestListener.prototype.receive@resource://pdf.js/PdfStreamConverter.jsm:705:5
PdfStreamConverter.prototype.onStartRequest/proxy.onStopRequest/<@resource://pdf.js/PdfStreamConverter.jsm:909:11
FirefoxComClosure/<.request@resource://pdf.js/web/viewer.js:529:14
PdfDataRangeTransport_requestDataRange@resource://pdf.js/web/viewer.js:2977:9
transportDataRange@resource://pdf.js/build/pdf.js:2122:13
messageHandlerComObjOnMessage@resource://pdf.js/build/pdf.js:1219:9
2014-10-01 23:50:03 +02:00
Yury Delendik
c0e933682a Disables streaming in the extension when length is undefined. 2014-10-01 14:16:50 -05:00
Yury Delendik
a95123188a Disables hash options when PDFBug is disabled and fixed streaming regressions. 2014-09-26 11:49:18 -05:00
Brendan Dahl
9c56c6f9f6 Merge pull request #5263 from yurydelendik/stream
Implement streaming using moz-chunk-arraybuffer
2014-09-25 16:40:28 -07:00
Brendan Dahl
678fb0ea9f Merge pull request #5314 from yurydelendik/issue5313
Fixes names collisions in content.js
2014-09-23 14:01:53 -07:00
Tim van der Meij
6f3ae49b8c Adds pdfBugEnabled to the Chrome extension preferences 2014-09-20 10:24:04 +02:00
Yury Delendik
c3f191a27c Implement streaming using moz-chunk-arraybuffer 2014-09-19 19:05:25 -05:00
Yury Delendik
63b7fa5634 Merge branch 'issue-4954' of https://github.com/Snuffleupagus/pdf.js into hashes
Conflicts:
	web/viewer.js
2014-09-19 18:25:11 -05:00
Jim Mathies
b399f19426 Bug 1064496 review changes 2014-09-19 15:31:21 -05:00
Yury Delendik
861a7615ff Adds preprocessor directive to the X-Content-Security-Policy stuff 2014-09-19 15:18:37 -05:00
Yury Delendik
dd48d1c352 Fixes names collisions in content.js 2014-09-19 13:58:12 -05:00
Jonas Jenwald
8d27f38c64 Rename |_isPrefAllowed| to |_ensurePreferenceAllowed| in extensions/firefox/content/PdfjsChromeUtils.jsm 2014-09-18 15:06:34 +02:00
Jonas Jenwald
dbe756c406 Update the license header in extensions/firefox/content/pdfjschildbootstrap.js; see https://bugzilla.mozilla.org/show_bug.cgi?id=942707#c99 2014-09-18 12:08:48 +02:00
Jonas Jenwald
c00951e3e4 Add back pdfBugEnabled pref check in the |log| function in extensions/firefox/content/PdfStreamConverter.jsm 2014-09-18 12:08:48 +02:00
Jonas Jenwald
3ac9bd063d Fix setPreferences regression from the e10s patch (PR 5115) 2014-09-18 12:08:47 +02:00
Brendan Dahl
f6745d5b03 Merge pull request #5115 from yurydelendik/e10s
Firefox pdf viewer support for e10s (Bug 942707).
2014-09-17 14:28:41 -07:00
Yury Delendik
1cda4c7a4b Loading PDF.js extension into e10s windows 2014-09-17 16:14:04 -05:00
Yury Delendik
7ae7fd3d1a Adds DEFAULT_PREFERENCES to the PdfjsChromeUtils 2014-09-08 15:53:01 -05:00
Yury Delendik
782ed5cb67 Lint error fix for pdfjschildbootstrap.js 2014-09-08 15:44:21 -05:00
Rob Wu
7938081e81 streamsPrivate API change.
Since 25 February 2014 (crbug.com/345882)
2014-09-06 00:41:08 +02:00
Jim Mathies
f2096fe23f Firefox pdf viewer support for e10s (Bug 942707). 2014-09-05 17:33:52 -05:00
Rob Wu
1055350425 Chrome extension: Isolate pageAction logic
Remove pageAction logic from extension router, and put it in a
separate file. The pageAction URL parsing logic has been simplified,
and all pageAction-related files have been moved to a separate directory.
2014-08-22 23:00:39 +02:00
Yan Or
d8bc16362c Bug 1054590 - [pdf.js] Update to use gaia-header 2014-08-15 17:57:07 -07:00
Jonas Jenwald
86d06d650a Merge pull request #5153 from Rob--W/crx-preserve-reference-fragment
Preserve reference fragment in Chromium URL router
2014-08-09 12:38:15 +02:00
Rob Wu
4a399a0173 Disable spellcheck in Chromium's URL popup
These red waves below a URL are quite useless and only distracting.
2014-08-08 13:54:19 +02:00
Rob Wu
a1671fa512 Preserve reference fragment in Chromium URL router
Because removed reference fragments are no longer automatically copied
thanks to https://code.google.com/p/chromium/issues/detail?id=354653
2014-08-08 12:37:37 +02:00
Tim van der Meij
c29faaa22d Use strict equalities in make.js, external/* and extensions/* 2014-08-01 22:27:00 +02:00
Tim van der Meij
bf3aad8a95 Merge pull request #5082 from Rob--W/chromium-managed-preferences
Managed preferences for Chrome administrators
2014-07-30 23:58:25 +02:00
Tim van der Meij
1911bb28bb Merge pull request #5104 from Rob--W/crx-contentscript-fix
Use CSS.supports instead of '..' in ....style
2014-07-30 23:43:45 +02:00
Rob Wu
8bb96db3a0 Use CSS.supports instead of '..' in ....style
document.documentElement.style is null in some XML documents.
The previous snippet caused the following error:

Uncaught TypeError: Cannot use 'in' operator to search for 'animation' in null

To fix this bug, `'animation' in document.documentElement.style` has been
replaced with `CSS.supports('animation', '9s')`. This method was introduced
in Chromium 28, but it is not necessary to detect whether this method is
supported because the required createShadowRoot method for embeds is not
available in Chromium 32 and earlier.
2014-07-30 23:11:02 +02:00
Rob Wu
00746011a3 Managed preferences for Chrome administrators
Implement support for managed preferences. This feature allows users
(administrators) to easily change the default settings of the PDF Viewer for
all Chrome or Chromium browsers within their organization.

External resources for end users (administrators)

- http://www.chromium.org/administrators/
- http://www.chromium.org/administrators/configuring-policy-for-extensions
- http://www.chromium.org/administrators/windows-quick-start
- http://www.chromium.org/administrators/mac-quick-start
- http://www.chromium.org/administrators/linux-quick-start
- http://www.chromium.org/administrators/policy-templates

Administrators can read one of the previous links to learn more about creating
policies. We want to auto-generate these templates, but there are no public
tools for doing that. It will be added in the future, see:
https://code.google.com/p/chromium/issues/detail?id=389061

Resources for PDF.js/extension developers

- http://cs.chromium.org/file:policy_templates.json
- https://developer.chrome.com/extensions/manifest/storage
2014-07-30 22:51:56 +02:00
Rob Wu
87dacba9a6 Feature detection after downgrading the browser.
If a user downgrades from Chromium 35+ to 34, then the PDF Viewer
extension will not work any more because the extension assumes
that certain features were available based on the cached feature
detection results.

To resolve this problem, all feature detection scripts run again
if the browser was downgraded.
2014-07-25 22:44:03 +02:00
Yury Delendik
ab63f96a91 Adds telemetry to record embedding usages 2014-06-16 16:41:04 -05:00
Yury Delendik
0cd28ebfa3 Telemetry for used stream and font types 2014-06-16 16:41:04 -05:00
Jonas Jenwald
1ba31a6cb7 Add pdfBugEnabled to the default preferences 2014-06-16 21:46:39 +02:00
Yury Delendik
7ac1c6b034 Reporting print usage 2014-06-14 15:55:21 -05:00
Yury Delendik
75d9ae9cd3 PdfRedirector checks if plugin is still in PlayPreview mode 2014-06-02 09:27:28 -05:00
Yury Delendik
68b037ffb0 Add preprocessor directives for the extension; and refactor FirefoxCom callback 2014-05-28 10:24:06 -05:00
Gijs Kruitbosch
da93e65d8c Bug 1015115 - switch to cloneInto in pdf.js, r?yury 2014-05-28 10:22:49 -05:00
Jonas Jenwald
f386501937 Update overlay stubs for the B2G viewer 2014-05-25 21:33:15 +02:00
Tim van der Meij
6d330250da Merge pull request #4549 from Rob--W/crx-pdf-embed-object
<object> / <embed> support in Chrome / Opera
2014-05-14 20:55:11 +02:00
Michał Gołębiowski
e625af3fef Remove type="text/javascript" from script tags.
"text/javascript" is not a correct MIME type (the correct one is
"application/javascript") but it's not even needed; all browsers default
to the correct type and treat it as executable JS when type is ommited.
Since not all browsers recognize the "application/javascript" MIME type
the only way to both stay compliant and to support all popular browsers
is to omit the type. It's also shorter this way.
2014-05-13 02:41:01 +02:00
Tim van der Meij
dc214e1c06 Merge pull request #4738 from Rob--W/allow-unsafe-eval
Allow unsafe-eval to fix font renderer in Chromium extension
2014-05-09 23:52:30 +02:00
Rob Wu
3fdd334a73 <object> / <embed> support in Chromium extension 2014-05-09 15:46:12 +02:00
Yury Delendik
9f9454d2ae Refactors new extension find bar code to support old FF versions 2014-05-08 09:05:28 -05:00
Adam Dane [:hobophobe]
bc66c8119e Add getFindBar for Fx extension 2014-05-07 18:45:24 -05:00
Rob Wu
d126be9a61 Allow unsafe-eval to fix font renderer in crx
Fixes #4660
2014-05-05 12:11:35 +02:00
Tim van der Meij
c566feb721 Providing content type for attachment downloads 2014-04-25 23:30:51 +02:00
Samuel Chantaraud
5bb937c5d7 Added fake button and view to b2g viewer 2014-04-18 12:26:08 -04:00
Samuel Chantaraud
25ee0e8572 Preliminary attachments support
Added a partial Filespec support
Added getAttachments in API
Added a new attachments view in UI (with a new icon by @shorlander)
2014-04-18 12:11:00 -04:00
Yury Delendik
b39f0c311c Refactors history and how the database is stored 2014-04-03 13:23:18 -05:00
Jonas Jenwald
4c9c43f82b Modify {get, set}Preferences in PdfStreamConverter.jsm to support async 2014-04-03 10:17:35 +02:00
Rob Wu
ae32f31eb4 Use redirectUrl at onHeadersReceived if available.
http://crbug.com/280464 has been resolved, so we can now use redirectUrl at
onHeadersReceived.
For backwards-compatibility, the code for the original method has not been
removed, and a feature detection script was added that detects whether the
desired feature is available.
2014-03-30 00:25:37 +01:00
Rob Wu
d04f81b964 Improved FTP support for Chromium extension 2014-03-30 00:08:02 +01:00
Jonas Jenwald
3fee5345b9 [Firefox] Only load 'PdfStreamConverter' and 'PdfRedirector' when PDF.js is enabled 2014-03-27 16:01:13 +01:00
Jonas Jenwald
f6cfab0061 [Firefox] Stop importing default_preferences.js as a module and include it instead 2014-03-26 00:37:32 +01:00
Yury Delendik
dbbe702be5 Merge pull request #4501 from Snuffleupagus/firefox-lazy-load-network
[Firefox] Lazy load network.js in PdfStreamConverter.js
2014-03-25 18:11:24 -05:00
Jonas Jenwald
2b5fb59b67 Fix coding style in extensions/firefox/bootstrap.js 2014-03-22 21:48:00 +01:00
Jonas Jenwald
597d388930 Fix coding style in extensions/firefox/tools/l10n.js 2014-03-22 21:45:08 +01:00
Jonas Jenwald
2017f7925e [Firefox] Lazy load network.js in PdfStreamConverter.js 2014-03-21 17:39:55 +01:00