Skip to content

Comments

fix: prevent top frame navigation when loading homepage#7

Open
sissbruecker wants to merge 1 commit intodaisylb:masterfrom
sissbruecker:fix/prevent_navigation_on_load
Open

fix: prevent top frame navigation when loading homepage#7
sissbruecker wants to merge 1 commit intodaisylb:masterfrom
sissbruecker:fix/prevent_navigation_on_load

Conversation

@sissbruecker
Copy link

@sissbruecker sissbruecker commented Jan 1, 2023

Currently just opening a new tab can result in the home page being loaded into the top frame, which has the negative side effect that the address bar is now filled with the home page's URL. The issue is that the onBeforeNavigate listener can already be triggered by setting the initial home page URL on the new tab iframe here:

document.querySelector("iframe").src = homepage

This change fixes the issue by preventing the listener from changing the top frame location if the URL being navigated to is the home page.

Fixes #4

@Seigiard
Copy link

Hey, @sissbruecker

I've made a fork of New Tab Extension
https://addons.mozilla.org/en-US/firefox/addon/new-tab-shows-your-homepage/

It includes your fix

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.

Recently url of my start page has started displaying in my start page making it hard to just type a search/url in it now.

2 participants