Skip to content
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

Merged
merged 1 commit into from
Sep 11, 2014

Conversation

mancas
Copy link
Contributor

@mancas mancas commented Sep 2, 2014

No description provided.

@@ -597,6 +606,14 @@ var PDFView = {
}
},

isBlob: function pdfViewIsBlob(url) {
if (url.indexOf('blob') != -1) {
Copy link
Contributor

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

Copy link
Contributor

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 '!='.

@yurydelendik yurydelendik mentioned this pull request Sep 2, 2014
@mancas mancas force-pushed the bug branch 2 times, most recently from 2c395a6 to 894d1bd Compare September 5, 2014 07:05
} else if (file.url && file.originalUrl) {
this.fileUrl = file.originalUrl;
this.url = file.url;
this.pdfViewSetTitleUsingUrl(file.url);
Copy link
Contributor

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

Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.setTitleUsingUrl(file.originalUrl);

@yurydelendik
Copy link
Contributor

The patch contains unrelated changes. Only two chunks of changes are expected in viewer.js.

@mancas mancas force-pushed the bug branch 3 times, most recently from 5c4d2f7 to e8909f6 Compare September 10, 2014 06:21
@yurydelendik
Copy link
Contributor

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_preview from @yurydelendik received. Current queue size: 0

Live output at: http://107.22.172.223:8877/9a628d0cba3bd5a/output.txt

@yurydelendik
Copy link
Contributor

@mancas looks good. could you change the commit message?

yurydelendik added a commit that referenced this pull request Sep 11, 2014
Avoid showing 'blob..' as a title when using pdfjs from B2G
@yurydelendik yurydelendik merged commit 74d02c3 into mozilla:master Sep 11, 2014
@yurydelendik
Copy link
Contributor

Thank you for the patch

The-Compiler added a commit to qutebrowser/qutebrowser that referenced this pull request Mar 14, 2023
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
The-Compiler added a commit to qutebrowser/qutebrowser that referenced this pull request Mar 14, 2023
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants