Forum Academy Marketplace Showcase Pricing Features

Trigger costum event within javascript code

Hi guys,

I’m using auth2 signin to my app with Discord.
I want to open a new tab after the user signed in.
I have a plugin for open url page in new tab, but when i’m using this plugin in the workflow after the signin, the browser blocks my new tab (a protection of broswers).
I found a way to workaround the browser’s protection but I need to use JS code.
What I found is something like that:

var win = window.open();
win.location = ‘https://example.com’;
win.opener = null;
win.blur();
window.focus();

The workaround is first open the new tab and then change it’s location.
I want to trigger a custom event for signin between before win.location.
Something link that:

var win = window.open();

win.location = ‘https://example.com’;
win.opener = null;
win.blur();
window.focus();

Can I trigger an event of bubble within javascript code?

Yes you can! Part of the free Toolbox plugin there is a “JavaScript to Bubble” tool. Check that out.

1 Like

I used this plugin but didn’t know I can trigger an event. Thanks man!

1 Like

@e.plus.dev1 @robhblake I’ve seen a few threads saying it’s possible with the Toolbox plugin now, but I haven’t seen anyone explain how that’s done. How do you do it?

Really appreciate any guidance. Thanks.

Hey Alex,

You can check out the plugin author’s post explaining how to use the feature. Just install the plugin, place the “Javascript to Bubble” element on the page and follow the instruction in the editor.

Rob