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

fix: Replace iframe location instead of pushing to the history stack. #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iwoplaza
Copy link

HI! 👋
When using SVGOMG I notices that whenever I made a change to the compression settings, a new entry was being pushed to the history stack, essentially making it impossible to go back to the page that referred me to SVGOMG:

Screenshot 2025-01-11 at 19 23 53

Bug investigation

I put a breakpoint in the event handler of one of the inputs, and eventually found the exact statement causing this problem. Essentially, changing an iframe's src attribute causes a new entry on top of the history stack. Using a slightly different API, the iframe's location can be replaced without adding onto the stack.

This PR

Introduces a fix that replaces the SVG iframe's location, instead of pushing a new entry to the history stack 💜

Copy link

netlify bot commented Jan 11, 2025

Deploy Preview for svgomg ready!

Name Link
🔨 Latest commit 9928a0f
🔍 Latest deploy log https://app.netlify.com/sites/svgomg/deploys/6782ba409b2ce6000894e5f9
😎 Deploy Preview https://deploy-preview-455--svgomg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant