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

Wraps worker script if its cross-origin location is detected. #6753

Merged
merged 1 commit into from
Jan 27, 2016

Conversation

yurydelendik
Copy link
Contributor

Allows to specify a worker path located at different domain.

@@ -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]));
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@yurydelendik yurydelendik force-pushed the cdn-worker branch 2 times, most recently from 9070930 to 13cab34 Compare December 14, 2015 19:34
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: it returns

@timvandermeij
Copy link
Contributor

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 src/shared/util.js by using the properties from the URL constructor.

@yurydelendik yurydelendik force-pushed the cdn-worker branch 2 times, most recently from 02bd1da to 0517e47 Compare January 15, 2016 21:05
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/345a4592c3adaf7/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/f7fa820812cf1d8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/3b63bf7580afdef/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/3b63bf7580afdef/output.txt

Total script time: 21.25 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/f7fa820812cf1d8/output.txt

Total script time: 21.59 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

brendandahl added a commit that referenced this pull request Jan 27, 2016
Wraps worker script if its cross-origin location is detected.
@brendandahl brendandahl merged commit 252b9d5 into mozilla:master Jan 27, 2016
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.

5 participants