How to open URL in a new tab in Chrome without making it active tab?

I need steps of a macro in such a way that, it will open a URL (passed on to it from the earlier steps of the macro) in a new tab but this new tab should not become an active tab. While opening this URL, brave browser would already be at front due to the previous steps of the macro.

My use case: I need to opne multiple URLs. Mostly are social media profiles. I am trying to avoid being flagged as a bot. So while I am actively scrolling through my current tab, I need rest of the URLs open with considerable amount of pause time in between. I will be scrolling my current tab with either trackpad, up/down buttons or J/K keys.

PS: I need to be able to set a custom pause time after the URL opens in adjacent tab (without making the adjacent tab active).

Before considering how to do this in a macro: do you have any evidence that it is possible at all? :thinking: I don't think it is.

You can't -- that functionality was removed after people started using it to eg spawn multiple porn-showing background tabs when you visited their website!

The best you can do is to open a new tab and then go back to your previously-active one. Using KM actions:

You might get a speed increase by opening a new, blank, tab with a script (JS or AS), going back to the "main" tab, then setting the URL of the new tab in the background -- reduced page load time may make the action complete faster -- but that seems like needless complication at this point. See if the above works for you first!

1 Like

I have no clue but when I searched in the forum before posting my question here, i bumped into few posts. I couldn't figure out which steps exactly should I implement in my macro hence i posted here. so all along i was under an opinion that it is possible.
@Nige_S Are these posts from the time when it was technically possible?

1 Like

somehow this is not working. here is a macro that have only these steps.

switch back to previously active tab.kmmacros (20.2 KB)

I don't use Brave, but if I were you I would put a brief pause after the "New Front Browser Tab" action. Then see if it works.

i tried that. doesn't work. (assuming you are talking about the screenshot and macro I shared)
I tried that even in google chrome, didn't work.

Oh. Well, I spotted a problem anyway. Your "Set Variable" action is flawed. In it you are assigning a variable the value "FRONTBROWSERTABINDEX()". What you should be doing is evaluating the function instead of saving those letters into a variable. There are two ways to do that. I recommend that you replace the "Set Variable to Text" action with "Set Variable to Calculation" action. That way your function will be evaluated, which is what you need.

That will correct one issue, but since I don't have Brave I can't guarantee it will fix your entire macro.

1 Like

Hello @fluid_eye :wave:

Airy (@Airy) is right but only up to 50%.

There is also a Calculate Token that can be used to evaluate the Function inside a Set Variable to Text Action - so you don’t need to change it to the other action.

Have you set the preferences for the Front Browser Actions and Tokens to use Brave ?!

Maybe you’ve forgotten about this ?! This would be in fact a major issue in your Macro.

Greetings from Germany :de:

Tobias

Hello @Nr.5-need_input , thanks for chipping in.

I have no idea how to do that.

i used suggestion of @Airy and it worked :+1:

Thank you @Nige_S

I'm glad it worked.

What he meant was that you can use a "token" to fix this problem using the Set Variable to Text action, and it would look like this:

image

This is what I was alluding to in my first post as another method. They produce the same result, just in slightly different ways.

1 Like

Already answered, but remember that the Editor does try to help whenever it can. In this case:

image

Tabs in a window are numbered, 1 is left-most, then 2, etc. So you'd expect to see a number in there, not text. That's your clue that you've used either the wrong action or the wrong token.