Author Topic: Use "javascript:void(window.open" in Run application  (Read 2367 times)

Nostrildumbass

  • Newbie
  • *
  • Posts: 4
Use "javascript:void(window.open" in Run application
« on: January 12, 2024, 11:13:32 AM »
Hi all,

I'm wondering how I can insert this into VoiceAttack to get it to open a browser window using a javascript:void like below. It doesn't seem to work and I'm having trouble figuring out a way to do it. Normally, just throwing a URL into Run Application will open it, but this isn't being treated the same and I'm guessing it's because VoiceAttack doesn't know what to do with javascript:void.

javascript:void(window.open('https://player.twitch.tv/?channel=shroud&enableExtensions=true&muted=true&parent=twitch.tv&player=popout&volume=0%27,%27popout_chat%27,%27width=800,height=400%27))

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Use "javascript:void(window.open" in Run application
« Reply #1 on: January 12, 2024, 11:22:28 AM »
Could you just put the url portion in an Other > Windows > Run an Application action?

Code: [Select]
https://player.twitch.tv/?channel=shroud&enableExtensions=true&muted=true&parent=twitch.tv&player=popout&volume=0%27,%27popout_chat%27,%27width=800,height=400%27
Edit - That is, remove the 'javascript:void(window.open())' portion from what you're already doing.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Use "javascript:void(window.open" in Run application
« Reply #2 on: January 12, 2024, 11:33:35 AM »
VoiceAttack is making an API call to Windows with that input, it doesn't do anything with it that it wouldn't with a normal file path. It has no direct control over what Windows does with it.

It wouldn't be treated as a URL because it isn't one; a valid URL specifies the protocol followed by ://

This would be something the browser you're using would need to support.
You'd have to check the command line options for the specific browser you're using, to see if there's a more explicit method to pass something like this.


As an aside, that snippet may be missing a closing single quote.

Nostrildumbass

  • Newbie
  • *
  • Posts: 4
Re: Use "javascript:void(window.open" in Run application
« Reply #3 on: January 12, 2024, 11:42:22 AM »
Could you just put the url portion in an Other > Windows > Run an Application action?

Code: [Select]
https://player.twitch.tv/?channel=shroud&enableExtensions=true&muted=true&parent=twitch.tv&player=popout&volume=0%27,%27popout_chat%27,%27width=800,height=400%27
Edit - That is, remove the 'javascript:void(window.open())' portion from what you're already doing.

It does open that way and it's what I'll have to resort to for now, but the javascript window.open specifically opens it in a more minimialistic window without all the browser UI which is what I'm hoping to achieve; if you create a bookmark with the full command and open it you'll see what I mean (it's just a Twitch stream)