Links on the page open in the iframe
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.
Can't extensions mess around with the DOM on the page? Otherwise how would GreaseMonkey work? Or is that not possible in this circumstance?
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.
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!
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.
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.
The experimental option to fix this (#14) is published on AMO as v1.0.0.
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!
This addon correctly opens the links without iframes. Could we copy that part?