pdf.js/web
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
..
images Add mirrored triangle (TOC item icon) 2015-09-06 15:35:58 +02:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
annotation_layer_builder.css Implement support for Highlight annotations 2016-01-01 15:31:46 +01:00
annotation_layer_builder.js Refactor annotation display layer code to use classes 2015-12-19 19:31:37 +01:00
chrome-i18n-allow-access-to-file-urls.json Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
chromecom.js Allow local PDF files to be viewed in local frames 2016-02-10 14:52:54 +01:00
compatibility.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
compressed.tracemonkey-pldi-09.pdf Add Makefile. Move some files around to make building the website easier. 2011-07-05 10:53:57 -07:00
debugger.js Replaces literal {} created lookup tables with Object.create 2016-01-28 12:18:38 -06:00
default_preferences.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
download_manager.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
firefoxcom.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
grab_to_pan.js Handtool: Remove focus from previous node on click 2014-09-03 16:31:47 +02:00
hand_tool.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
interfaces.js Remove a superfluous "s" in AnnotationsLayerBuilder from files in web/ 2015-12-18 19:55:54 +01:00
mozPrintCallback_polyfill.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
overlay_manager.js Remove unused variables 2015-12-16 23:52:16 +01:00
password_prompt.js Set type="password" for the PasswordPrompt input dynamically, to prevent unnecessary warnings in Firefox for http:// documents (issue 6898) 2016-01-20 13:54:19 +01:00
pdf_attachment_view.js Strip null (\x00) characters from the URLs in LinkAnnotations (issue 6832) 2016-01-04 21:55:20 +01:00
pdf_document_properties.js Remove unused variables 2015-12-16 23:52:16 +01:00
pdf_find_bar.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdf_find_controller.js Replaces literal {} created lookup tables with Object.create 2016-01-28 12:18:38 -06:00
pdf_history.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdf_link_service.js [Firefox] Prevent internal links from displaying "resource://pdf.js/web/" on hover, by tweaking the fallback case in PDFLinkService_getDestinationHash 2015-12-09 10:07:39 +01:00
pdf_outline_view.js [api-minor] Add support for URLs in the document outline 2016-01-19 21:36:27 +01:00
pdf_page_view.js Use RequireJS in the viewer, examples and tests. 2015-12-29 09:20:52 -06:00
pdf_presentation_mode.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdf_rendering_queue.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdf_thumbnail_view.js Merge pull request #6551 from yurydelendik/subaa 2015-11-17 19:45:32 -06:00
pdf_thumbnail_viewer.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
pdf_viewer.component.js Remove a superfluous "s" in AnnotationsLayerBuilder from files in web/ 2015-12-18 19:55:54 +01:00
pdf_viewer.css Remove a superfluous "s" in AnnotationsLayerBuilder from files in web/ 2015-12-18 19:55:54 +01:00
pdf_viewer.js Remove a superfluous "s" in AnnotationsLayerBuilder from files in web/ 2015-12-18 19:55:54 +01:00
preferences.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
secondary_toolbar.js Uses editorconfig to maintain consistent coding styles 2015-11-14 07:32:18 +05:30
text_layer_builder.css Use default line height for the text layer 2015-12-02 23:00:12 +01:00
text_layer_builder.js Move text layer building logic into src/display/text_layer.js 2015-11-19 10:50:27 -06:00
ui_utils.js Strip null (\x00) characters from the URLs in LinkAnnotations (issue 6832) 2016-01-04 21:55:20 +01:00
view_history.js Remove unused variables 2015-12-16 23:52:16 +01:00
viewer-snippet-chrome-extension.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer-snippet-chrome-overlays.html Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
viewer-snippet-firefox-extension.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer-snippet-minified.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer-snippet-mozPrintCallback-polyfill.html Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox 2015-03-07 00:16:55 +01:00
viewer-snippet.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer.css Better "text" testing. 2015-11-19 11:03:52 -06:00
viewer.html Set type="password" for the PasswordPrompt input dynamically, to prevent unnecessary warnings in Firefox for http:// documents (issue 6898) 2016-01-20 13:54:19 +01:00
viewer.js Allow foriegn origin URLs only for hosted viewers. 2016-01-22 11:54:19 -06:00