Home > Back-end >  Is there any way I can open new tabs on Chrome without javascript?
Is there any way I can open new tabs on Chrome without javascript?

Time:09-17

I am creating a website and on the website, I need about 10-20 more tabs on the user device,

I know how to do this with javascript but the user can disable javascript on the browser which basically stops the entire point of the website, is there any way to do it without javascript (maybe sending a header to Chrome or something that opens a website in a tab)?

CodePudding user response:

There is no way to do that without JavaScript to open multiple tabs at once.

You can make a link open a new tab with the target attribute when clicked by the user, but that is limited to one new tab for one user interaction.

maybe sending a header to Chrome or something that opens a website in a tab

Even if that would be possible with some kind of trick, it would likely be fixed in an update in the browsers, because this will this would be definitely be abused by dubious websites.

CodePudding user response:

Well, the pure HTML way to do that is through the target attribute of any hyperlinked element (A, FRAME, FORM), which shall contain the name of the window that should receive the content of the hyperjump.

Example:

<!--These two hyperlinks redirect the URLs to the same tab-->
<A href="..." target="clients">local clients</A>
<A href="..." target="clients">inernational clients</A>

<!--This hyperlink redirect the URL to its own tab-->
<A href="..." target="providers">providers</A>

Anyway, I warn you not to abuse of this form of forced navigation, because it can chase your user out of your website: The user should be left as free as possible to chose to open or not new tabs/windows. And 10-20 tabs seems to me an overwhelming amount of tabs.

  • Related