firefox-custom-new-tab-page icon indicating copy to clipboard operation
firefox-custom-new-tab-page copied to clipboard

Links on the page open in the iframe

Open MethodGrab opened this issue 8 years ago • 8 comments

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.

MethodGrab avatar Jun 04 '17 14:06 MethodGrab

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

RandomEngy avatar Nov 17 '17 16:11 RandomEngy

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.

MethodGrab avatar Nov 18 '17 23:11 MethodGrab

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!

RandomEngy avatar Nov 21 '17 04:11 RandomEngy

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.

Park0 avatar May 19 '20 09:05 Park0

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 avatar May 22 '20 18:05 MethodGrab

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

MethodGrab avatar Oct 29 '20 23:10 MethodGrab

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!

Park0 avatar Oct 30 '20 08:10 Park0

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

image

mrx23dot avatar Dec 16 '23 21:12 mrx23dot