-
Notifications
You must be signed in to change notification settings - Fork 11
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
Execute print user script in page content world #238
Conversation
Unfortunately I don't have time to finish up this review before heading out for the rest of the week, unassigning myself for now. But, I do think we should add a |
@alistairjcbrown, I'm sorry, but this is a bit harder to follow. Is the next step review or is additional work required? |
Checking in on this PR, I'd like to close it out this week. I have some BSK changes in mind that could help out with this, will see about implementing those during Quick Wins Days this week. |
001a146
to
cb0f965
Compare
This PR works as expected, but to get there I guess ideally this PR could have some review to see if the approach is suitable for now -- and weigh that against if we'd first want to, a) figure out a nicer way to make the chosen content world configurable and, b) then back port this approach to Edit: There may also be tests failing -- I have access to bitrise now, so I'll take a look once this CI run finishes |
cb0f965
to
0a68d1c
Compare
@alistairjcbrown Finally taking a proper look at this, so sorry for the wait EDIT: yet again F&F has foiled this, despite my best attempts |
The print user script needs to execute in the page content world so that it mutates the globals used by the page which the user is interacting with. The existing setup runs scripts under the default content world (which is what you generally want), but this script is a special case as we want to overwrite a global function on the window object.
0a68d1c
to
cb58a76
Compare
@samsymons @jonathanKingston Updated to use |
@jonathanKingston @samsymons Updated for feedback -- the diff for this PR is looking pretty sweet! 😁 |
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.
@alistairjcbrown You weren't kidding, this is super clean. ✨ LGTM!
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.
Thanks for cleaning up based on feedback! 💯
* develop: Avoid using a specific browser as the default. (#341) Closing animation duration changed to 0.15 (#333) Hiding the favicon view when favicon is nil (#326) export bookmarks (#339) Ensure ITP database is cleared (#328) Execute print user script in page content world (#238) move the next/previous handlers to the main view controller (#331) Search with DuckDuckGo in PDF Context Menu (#323) Fix Back button takes to r.duckduckgo.com (#321) Track the existing print handler to avoid DoS attacks. (#330) Minor copy fixes (#325) support cmd-option-left/right for navigating tabs (#324) Version 0.17.5 Debounce privacy entry point update (#309) Change major tracker network threshold (#319) Check for click handler on printing user script (#318) Fix Homepage navigation (#322)
* develop: (23 commits) Update the credit card model + UI tweaks (#342) 0.17.6 Add Usage Pixel (#336) Bump find-in-page to latest version (#337) Forward delete collision with suffix resolved (#334) Avoid using a specific browser as the default. (#341) Closing animation duration changed to 0.15 (#333) Hiding the favicon view when favicon is nil (#326) export bookmarks (#339) Ensure ITP database is cleared (#328) Execute print user script in page content world (#238) move the next/previous handlers to the main view controller (#331) Search with DuckDuckGo in PDF Context Menu (#323) Fix Back button takes to r.duckduckgo.com (#321) Track the existing print handler to avoid DoS attacks. (#330) Minor copy fixes (#325) support cmd-option-left/right for navigating tabs (#324) Version 0.17.5 Debounce privacy entry point update (#309) Change major tracker network threshold (#319) ...
Task/Issue URL: Related to https://app.asana.com/0/1199230911884351/1200442572797700/f
Tech Design URL:
CC:
Description:
The print user script needs to execute in the page content world so that
it mutates the globals used by the page which the user is interacting
with. The existing setup runs scripts under the default content world
(which is what you generally want), but this script is a special case as
we want to overwrite a global function on the window object.
Steps to test this PR:
window.print()
Testing checklist:
Internal references:
Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM