open-in-browser icon indicating copy to clipboard operation
open-in-browser copied to clipboard

Dropbox uses a <iframe>, breaking open-in-browser function

Open yan12125 opened this issue 8 years ago • 3 comments

I didn't find where the <iframe> actually is. I guess it's either hidden or quite small. As a result, I can't see the document opened in browsers. A possible way is rewriting location.url of the top window, which https://github.com/est31/openinbrowser does. I'm not sure if it's a good idea.

A sample link: https://www.dropbox.com/s/wqe3ulba3m5w189/%C3%A0.txt?dl=0

yan12125 avatar Oct 06 '17 14:10 yan12125

Overwriting the URL only works if the URL can be re-used. This is for most GET requests, but not for one-time GET requests and POST requests (form submissions). Even for these cases I can think of a way to open the content in a new tab* anyway (by opening a new URL, completely ignoring the response for that new URL, and redirecting the response of the original request to that new URL).

* The content should be in a new tab, because the original response stream is canceled if the tab unloads.

Rob--W avatar Oct 22 '17 23:10 Rob--W

Thanks for the explanation. I guess #5 is a more elegant fix? The write up looks great and I need to check it out.

yan12125 avatar Oct 26 '17 16:10 yan12125

#5 is unrelated to this, but the explanation about redirection of streams can indeed be used here. In #5 I described how a response can be redirected to a different frame, which can also be used to show the content in a completely different/new tab.

Rob--W avatar Nov 01 '17 17:11 Rob--W