MethodGrab / firefox-custom-new-tab-page

A Firefox extension that allows you to specify a custom new-tab URL
https://addons.mozilla.org/firefox/addon/custom-new-tab-page
ISC License
76 stars 18 forks source link

Links on the page open in the iframe #1

Open MethodGrab opened 7 years ago

MethodGrab commented 7 years ago

Clicking links on the chosen new tab page will open them inside the iframe not the top frame unless the links have the target="_top" attribute.

AFAIK there's no work around for this unless you control the site that is being used. If you do control it, you can add target="_top" to each link or include <base target="_top"> in the <head> to apply it to all links.

RandomEngy commented 6 years ago

Can't extensions mess around with the DOM on the page? Otherwise how would GreaseMonkey work? Or is that not possible in this circumstance?

MethodGrab commented 6 years ago

You're right, it seems this might be possible with the webRequest API. I'll play around with the API a bit and see if it can be done.

RandomEngy commented 6 years ago

I was hoping it would be as simple as mucking with the already loaded elements. Loading from the WebRequest API sounds a lot harder because you have all the JS/CSS/XHR to deal with. Anyhow thanks for looking into it!

Park0 commented 4 years ago

Would it be possible to do this with javascript? https://stackoverflow.com/questions/6158903/need-to-break-out-of-iframe-after-content-in-iframe-is-submitted by monitoring the location of the iframe and redirect the main page when it is linked to another domain. I have not yet tried it myself.

MethodGrab commented 4 years ago

I've made a proof of concept that seems to work! It's a bit hacky so I'll tidy it up and create a PR for people to test it out when I can.

MethodGrab commented 3 years ago

The experimental option to fix this (#14) is published on AMO as v1.0.0.

Park0 commented 3 years ago

Does the page need a special target or something to get it to work? I updated the plugin. Enabled the option in the settings. Accepted the extra permission. But it still does not open in the same tab for me.

Thanks for working on this your add-on is great!

mrx23dot commented 10 months ago

This addon correctly opens the links without iframes. Could we copy that part?

image