vscode-vs-browser icon indicating copy to clipboard operation
vscode-vs-browser copied to clipboard

Open some links in external browser?

Open abdulajet opened this issue 1 year ago • 7 comments

Some webpages block being loaded in an iframe so they dont work in the browser. It would be cool if you should specify a pattern of URLs that should be opened in the default external browser instead.

abdulajet avatar Nov 21 '24 13:11 abdulajet

@abdulajet Thank you for your suggestion Instead of the need to specify a pattern of URLs that should be opened in the default external browser I have another idea. Do you think it is better or it does not meet your needs?

  • In case the link doesn't work, then a dialog or a UI that shows "click to open in external browser`

I think it is easier to use. What do you think about this?

Phu1237 avatar Nov 23 '24 14:11 Phu1237

Sorry for the long response time, i think that would work. The only issue is that it will navigate them away from the working page, to a broken page then show the popup. So people will see the broken page.

So I think both should be good? That way if you see a broken page you can add it to the URL list that needs to be opened externally

abdulajet avatar Nov 26 '24 17:11 abdulajet

@abdulajet That interesting. I have never thought of this before 😂 I will try it and maybe add a setting to choose between these ideas Thanks!

Phu1237 avatar Nov 27 '24 03:11 Phu1237

@Phu1237 what is the expected behaviour for a link that is supposed to open in a new tab? e.g.

<a href="https://www.google.com" target="_blank">

abdulajet avatar Dec 02 '24 17:12 abdulajet

@abdulajet That seems a good idea but I think the iframe won't let me inject code into it (to catch click and send the event back to the extension to open in a new tab) I will try it in the new version If I can't implement this, it will be on my todo list when I find a way to bypass the cors Thank for your good idea ✨

Phu1237 avatar Dec 03 '24 06:12 Phu1237

@Phu1237 sorry to clarify, what is supposed to happen at the moment?

abdulajet avatar Dec 03 '24 09:12 abdulajet

@abdulajet Sorry for the late response. I have some problems with my PC so I can't test it Answer to your question: Nothing happens when clicking the link Same as:

  • _parent
  • _top (This will throw an error to the console)

Still direct in vs browser:

  • _self

I hope this information is useful to you Thanks!

Phu1237 avatar Dec 04 '24 13:12 Phu1237