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

[api-minor] Remove the document.currentScript polyfill #10517

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

This polyfill is currently used in only one file, i.e. src/display/api.js, and only when trying to build a fallback workerSrc path.

Given that the global workerSrc should always be set[1] when using the PDF.js library[2], and that the fallback workerSrc should only be regarded as a best-effort solution anyway, there isn't a particularily strong reason to keep the compatibility code in my opinion.


[1] Other supported options include setting the global workerPort, or passing in a PDFWorker instance as part of the getDocument call.

[2] Which is clearly mentioned in the JSDocs in src/display/worker_options.js.

This polyfill is currently used in only *one* file, i.e. `src/display/api.js`, and only when trying to build a *fallback* `workerSrc` path.

Given that the global `workerSrc` should *always* be set[1] when using the PDF.js library[2], and that the fallback `workerSrc` should only be regarded as a best-effort solution anyway, there isn't a particularily strong reason to keep the compatibility code in my opinion.

---
[1] Other supported options include setting the global `workerPort`, or passing in a `PDFWorker` instance as part of the `getDocument` call.

[2] Which is clearly mentioned in the JSDocs in `src/display/worker_options.js`.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Feb 3, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/2b76b4616cfa737/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 3, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/2b76b4616cfa737/output.txt

Total script time: 1.70 mins

Published

@timvandermeij
Copy link
Contributor

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Feb 3, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/8bb24642fa7c78f/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 3, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/ffde2a38c17d8fa/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Feb 3, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/8bb24642fa7c78f/output.txt

Total script time: 2.55 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Feb 3, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/ffde2a38c17d8fa/output.txt

Total script time: 5.08 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit 9f9d87c into mozilla:master Feb 3, 2019
@timvandermeij
Copy link
Contributor

timvandermeij commented Feb 3, 2019

Standardization is always good. Thank you!

@Snuffleupagus Snuffleupagus deleted the rm-currentScript-polyfill branch February 3, 2019 15:25
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.

3 participants