pdfjs: Use abosolute URLs
That allows us to use the "original" page URL when displaying with pdf.js, which means yanking the URL etc works as intended.
This commit is contained in:
parent
0ee13392e1
commit
5e0090d5b8
@ -309,8 +309,8 @@ class BrowserPage(QWebPage):
|
||||
elif mimetype in {'application/pdf', 'application/x-pdf'}:
|
||||
# Use pdf.js to display the page
|
||||
html_page = _generate_pdfjs(reply)
|
||||
#url = reply.url()
|
||||
url = QUrl('qute://pdfjs/web/viewer.js')
|
||||
url = reply.url()
|
||||
#url = QUrl('qute://pdfjs/web/viewer.js')
|
||||
self.mainFrame().setContent(html_page.encode('utf-8'),
|
||||
'text/html', url)
|
||||
reply.deleteLater()
|
||||
|
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright 2012 Mozilla Foundation
|
||||
|
||||
@ -29,21 +29,21 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||
<title>PDF.js viewer</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="viewer.css"/>
|
||||
<link rel="stylesheet" href="qute://pdfjs/web/viewer.css"/>
|
||||
|
||||
<script src="compatibility.js"></script>
|
||||
<script src="qute://pdfjs/web/compatibility.js"></script>
|
||||
|
||||
|
||||
|
||||
<!-- This snippet is used in production (included from viewer.html) -->
|
||||
<link rel="resource" type="application/l10n" href="locale/locale.properties"/>
|
||||
<script src="l10n.js"></script>
|
||||
<script src="../build/pdf.js"></script>
|
||||
<link rel="resource" type="application/l10n" href="qute://pdfjs/web/locale/locale.properties"/>
|
||||
<script src="qute://pdfjs/web/l10n.js"></script>
|
||||
<script src="qute://pdfjs/build/pdf.js"></script>
|
||||
|
||||
|
||||
|
||||
<script src="debugger.js"></script>
|
||||
<script src="viewer.js"></script>
|
||||
<script src="qute://pdfjs/web/debugger.js"></script>
|
||||
<script src="qute://pdfjs/web/viewer.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -36,9 +36,9 @@ var SCALE_SELECT_PADDING = 22;
|
||||
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
|
||||
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
|
||||
|
||||
PDFJS.imageResourcesPath = './images/';
|
||||
PDFJS.workerSrc = '../build/pdf.worker.js';
|
||||
PDFJS.cMapUrl = '../web/cmaps/';
|
||||
PDFJS.imageResourcesPath = 'qute://pdfjs/web/images/';
|
||||
PDFJS.workerSrc = 'qute://pdfjs/build/pdf.worker.js';
|
||||
PDFJS.cMapUrl = 'qute://pdfjs/web/cmaps/';
|
||||
PDFJS.cMapPacked = true;
|
||||
|
||||
var mozL10n = document.mozL10n || document.webL10n;
|
||||
|
Loading…
Reference in New Issue
Block a user