-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid showing 'blob..' as a title when using pdfjs from B2G #5254
Conversation
@@ -597,6 +606,14 @@ var PDFView = { | |||
} | |||
}, | |||
|
|||
isBlob: function pdfViewIsBlob(url) { | |||
if (url.indexOf('blob') != -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad comparison: url == 'http://site/blob.html' will be broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint error: web/viewer.js: line 610, col 31, Expected '!==' and instead saw '!='.
2c395a6
to
894d1bd
Compare
} else if (file.url && file.originalUrl) { | ||
this.fileUrl = file.originalUrl; | ||
this.url = file.url; | ||
this.pdfViewSetTitleUsingUrl(file.url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can call this.setTitleUsingUrl(file.originalUrl);
here without setting fileUrl. So you don't need fileUrl property, isBlob method and changes in the setTitleUsingUrl method.
pdfViewSetTitleUsingUrl is unknown method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to assign this.url to blob url too, original url is what is expected here.
} else if (file && 'byteLength' in file) { // ArrayBuffer | ||
parameters.data = file; | ||
} else if (file.url && file.originalUrl) { | ||
this.setTitleUsingUrl(file.url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.setTitleUsingUrl(file.originalUrl);
The patch contains unrelated changes. Only two chunks of changes are expected in viewer.js. |
5c4d2f7
to
e8909f6
Compare
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/9a628d0cba3bd5a/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/9a628d0cba3bd5a/output.txt Total script time: 0.90 mins Published
|
@mancas looks good. could you change the commit message? |
Avoid showing 'blob..' as a title when using pdfjs from B2G
Thank you for the patch |
A quick tour through the PDF.js API: v1.0.1040 introduced the ability to pass an object to PDFView.open() instead of passing an URL: mozilla/pdf.js#5254 v1.6.210 (?) renamed PDFView to PDFViewerApplication: ffa276a v3.3.122 made it mandatory to pass an object (and also made originalURL optional when doing so): mozilla/pdf.js#15972 We should probably properly get rid of old version support at some point (see #7619), but until then, I *think* this approach should work with older versions still. Fixes #7618
A quick tour through the PDF.js API: v1.0.1040 introduced the ability to pass an object to PDFView.open() instead of passing an URL: mozilla/pdf.js#5254 v1.6.210 (?) renamed PDFView to PDFViewerApplication: ffa276a v3.3.122 made it mandatory to pass an object (and also made originalURL optional when doing so): mozilla/pdf.js#15972 We should probably properly get rid of old version support at some point (see #7619), but until then, I *think* this approach should work with older versions still. Fixes #7618 (cherry picked from commit 924a7a5)
No description provided.