pdf.js/extensions/chromium
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
..
options Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pageAction Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
.gitignore Renaming of extensions/chrome folder to extensions/chromium, and small tweak to manifest.json description as per #3600 2013-08-21 18:11:35 +02:00
chrome.tabs.executeScriptInFrame.js Making extensions/chromium/chrome.tabs.executeScriptInFrame.js adhere to the style guide 2014-03-09 23:29:34 +01:00
contentscript.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
contentstyle.css <object> / <embed> support in Chromium extension 2014-05-09 15:46:12 +02:00
extension-router.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
feature-detect.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
icon16.png Bug 972435 - Recompress all PNG assets 2014-02-13 17:57:10 +01:00
icon19.png Bug 972435 - Recompress all PNG assets 2014-02-13 17:57:10 +01:00
icon38.png Bug 972435 - Recompress all PNG assets 2014-02-13 17:57:10 +01:00
icon48.png Bug 972435 - Recompress all PNG assets 2014-02-13 17:57:10 +01:00
icon128.png Bug 972435 - Recompress all PNG assets 2014-02-13 17:57:10 +01:00
manifest.json Chrome extension: Add options page 2015-01-14 00:01:29 +01:00
pdfHandler-v2.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdfHandler-vcros.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdfHandler.html Don't reload after updating if a tab is in use 2015-08-14 19:00:12 +02:00
pdfHandler.js Allow local PDF files to be viewed in local frames 2016-02-10 14:52:54 +01:00
preferences_schema.json Chrome extension: Add options page 2015-01-14 00:01:29 +01:00
preserve-referer.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
restoretab.html Restore extension tab after reload 2015-08-14 19:00:12 +02:00
restoretab.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
suppress-update.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30