edd4bae903
And use split incognito mode Previous method: - Rewrite content type to XHTML, followed by a content script to cancel and replace the document with the viewer. ( https://github.com/mozilla/pdf.js/pull/3017 ) New method: - Cancel loading of the document, followed by a redirect to the viewer Disadvantage of new method: - URLs are no longer "nice". This will be addressed by cherry-picking a commit from the crx-using-streams-api branch. Advantages of new method: - Idle time is minimal. In some cases (with large documents), it took too much time before the content script was activated. During this period, the page looked blank, and the contents of the PDF file were still retrieved and **discarded**. With the new method, the idle time is minimal, because the request is immediately cancelled. - No FOUXEP (Flash of unhidden XML error page), because the XHTML Content-Type hack is no longer used.
20 lines
726 B
HTML
20 lines
726 B
HTML
<!doctype html>
|
|
<!--
|
|
Copyright 2012 Mozilla Foundation
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
<script src="chrome.tabs.executeScriptInFrame.js"></script>
|
|
<script src="pdfHandler.js"></script>
|
|
<script src="pdfHandler-local.js"></script>
|