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

Bug: Address Widget doesn't show correct URL on redirects #53

Closed
2 tasks done
cookiengineer opened this issue Dec 5, 2020 · 1 comment
Closed
2 tasks done

Bug: Address Widget doesn't show correct URL on redirects #53

cookiengineer opened this issue Dec 5, 2020 · 1 comment
Assignees

Comments

@cookiengineer
Copy link
Member

cookiengineer commented Dec 5, 2020

The Address Widget doesn't show the correct URL when the iframe load leads to a redirect.

In order to fix this, the Webview Backdrop must include a method that will re-set (override?) the Tab's URL and change the history accordingly. Currently, inside the iframe based UI, it's not possible to detect a redirect otherwise.

On the server-side it's implemented correctly already, but this is a necessary hack that cannot be avoided.

In the on('load', () => {}) callback:

  • Validate that the loaded URL is the actual rendered Tab's URL (this.window.location.href must be parsed as if it were an src attribute)
  • If the URL isn't the same as it were before the load (the cached this.url attribute), modify the Tab's history without triggering a refresh event on the Browser.
@cookiengineer cookiengineer self-assigned this Dec 5, 2020
@cookiengineer cookiengineer added bug A nasty bug has hidden itself in the codebase. todo Task is ready to be worked on labels Dec 5, 2020
@cookiengineer cookiengineer added this to the X0 - Codename Spirit milestone Dec 5, 2020
@cookiengineer
Copy link
Member Author

As of 9772e4a this has been implemented.

Important Architecture Notes:

There's no event on the iframe that can be listened to in order to trace a redirect from the server-side. In order to detect redirects, the Webview Backdrop now has on the iframe's load event a mechanism that reparses the iframe window.location.pathname + window.location.search in order to find out where exactly the iframe currently leads to.

If there was a redirect detected, the Webview updates the current BROWSER.tab's history without emitting a potential event cycle, and updates both the Address and Mode widgets.

This leads to a Tab History change (which is intended, as it will always show the correct URL in the Address Bar), and therefore the Error Pages can simply call the BROWSER.back() method after successful modifications.

@cookiengineer cookiengineer removed bug A nasty bug has hidden itself in the codebase. todo Task is ready to be worked on labels Dec 6, 2020
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

No branches or pull requests

1 participant