PuzzleServer / mainpuzzleserver

The main repo for the Puzzle Hunt and Puzzleday servers.
MIT License
9 stars 32 forks source link

ebay print fix #1028

Closed jbodner09 closed 3 months ago

jbodner09 commented 3 months ago

Instead of opening a new tab to wherever the iframe was initially located when the page was loaded, have the embedded puzzle open its current page in a new tab when a print keyboard command or link click are detected. This allows puzzles like ebay, which navigate to different pages within the iframe, to correctly print the page they're on.

Also fixes a bug with PDF printing where ASP incorrectly escapes a + character in the URL for some reason.

Note 1: allowing the iframe to open popups requires adding the allow-popups-to-escape-sandbox permission to the iframe so the unembedded puzzle has full permissions to print, etc. as needed.

Note 2: Since some browsers aggressively block popups, "please allow popups" was added to the print link since otherwise the print link will appear to do nothing except initiate a tiny notification by the browser that a popup was blocked. It's currently unknown if this popup blocking was also an issue with the previous/current print implementation.

Note 3: Since different types of messages are now being sent to puzzles, an update to the puzzle resize code is also required. It will be uploaded to the event once this PR is deployed.