Bug 1054643 - [B2G][PDF Viewer]PDF Viewer title is shown as blob:...
This commit is contained in:
parent
8206894d24
commit
f40fa1ac2a
@ -633,7 +633,7 @@ var PDFView = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// TODO(mack): This function signature should really be pdfViewOpen(url, args)
|
// TODO(mack): This function signature should really be pdfViewOpen(url, args)
|
||||||
open: function pdfViewOpen(url, scale, password,
|
open: function pdfViewOpen(file, scale, password,
|
||||||
pdfDataRangeTransport, args) {
|
pdfDataRangeTransport, args) {
|
||||||
if (this.pdfDocument) {
|
if (this.pdfDocument) {
|
||||||
// Reload the preferences if a document was previously opened.
|
// Reload the preferences if a document was previously opened.
|
||||||
@ -642,11 +642,14 @@ var PDFView = {
|
|||||||
this.close();
|
this.close();
|
||||||
|
|
||||||
var parameters = {password: password};
|
var parameters = {password: password};
|
||||||
if (typeof url === 'string') { // URL
|
if (typeof file === 'string') { // URL
|
||||||
this.setTitleUsingUrl(url);
|
this.setTitleUsingUrl(file);
|
||||||
parameters.url = url;
|
parameters.url = file;
|
||||||
} else if (url && 'byteLength' in url) { // ArrayBuffer
|
} else if (file && 'byteLength' in file) { // ArrayBuffer
|
||||||
parameters.data = url;
|
parameters.data = file;
|
||||||
|
} else if (file.url && file.originalUrl) {
|
||||||
|
this.setTitleUsingUrl(file.originalUrl);
|
||||||
|
parameters.url = file.url;
|
||||||
}
|
}
|
||||||
if (args) {
|
if (args) {
|
||||||
for (var prop in args) {
|
for (var prop in args) {
|
||||||
@ -2521,9 +2524,10 @@ window.addEventListener('afterprint', function afterPrint(evt) {
|
|||||||
//window.navigator.mozSetMessageHandler('activity', function(activity) {
|
//window.navigator.mozSetMessageHandler('activity', function(activity) {
|
||||||
// var blob = activity.source.data.blob;
|
// var blob = activity.source.data.blob;
|
||||||
// PDFJS.maxImageSize = 1024 * 1024;
|
// PDFJS.maxImageSize = 1024 * 1024;
|
||||||
|
// var fileURL = activity.source.data.url;
|
||||||
//
|
//
|
||||||
// var url = URL.createObjectURL(blob);
|
// var url = URL.createObjectURL(blob);
|
||||||
// PDFView.open(url);
|
// PDFView.open({url : url, originalUrl: fileURL});
|
||||||
//
|
//
|
||||||
// var header = document.getElementById('header');
|
// var header = document.getElementById('header');
|
||||||
// header.addEventListener('action', function() {
|
// header.addEventListener('action', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user