-
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
Wraps worker script if its cross-origin location is detected. #6753
Conversation
@@ -1148,6 +1148,11 @@ var PDFWorker = (function PDFWorkerClosure() { | |||
return PDFJS.fakeWorkerFilesLoadedCapability.promise; | |||
} | |||
|
|||
function createCDNWrapper(url) { | |||
var wrapper = 'importScripts(\'' + url + '\');'; | |||
return URL.createObjectURL(new Blob([wrapper])); |
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.
Do we perhaps want to use PDFJS.createObjectURL
here instead, for maximum compatibility?
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.
Not really, I want it to fail here since blob:
scheme specifies its origin -- our polyfill does not.
9070930
to
13cab34
Compare
@@ -293,6 +293,27 @@ function combineUrl(baseUrl, url) { | |||
} | |||
} | |||
|
|||
// Extracts protocol and host from the URL. Mostly works for HTTP type of URL. | |||
// For non-HTTP URLs such as 'data:' or 'javascript:' is returns entire string |
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.
Nit: it returns
13cab34
to
e60befe
Compare
e60befe
to
0b3764a
Compare
Just as a note about what we discussed on IRC: now that we have the polyfill for the URL constructor, we can avoid the changes in |
02bd1da
to
0517e47
Compare
0517e47
to
1e45f2d
Compare
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/345a4592c3adaf7/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/345a4592c3adaf7/output.txt Total script time: 0.83 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/f7fa820812cf1d8/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/3b63bf7580afdef/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/3b63bf7580afdef/output.txt Total script time: 21.25 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/f7fa820812cf1d8/output.txt Total script time: 21.59 mins
|
Wraps worker script if its cross-origin location is detected.
Allows to specify a worker path located at different domain.