mIRC Home    About    Download    Register    News    Help

Print Thread
#251140 10/02/15 08:18 PM
Joined: Nov 2014
Posts: 79
N
Newbie Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Nov 2014
Posts: 79
So this code is supposed to run on the background as I am doing something else. Whenever I type !play start a google chrome window opens up and plays the youtube video. The first time it opens it opens the window and minimizes it (Awesome). However the second time around it opens up a new tab and shows the window, thus taking me out of the software I've got running. Is there any way to fix this? Or is there anyway to close an open browser window?

Code:
alias -l playYT {
  var %file songrequest.ini
  if (!$ini(%file,0)) return
  ; -----------------------------------------
  var %song $ini(%file,1)
  run -n www.youtube.com/watch?v= $+ %song
  var %timer $calc($ini(%file,%song,1) + 5)
  remini %file %song
  .timerplayYTcont 1 %timer playYT
}

Newbie #251149 11/02/15 01:07 AM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Technically speaking this might be a bug. It might be on purpose but I think /run -n on an url should run a new instance of the browser instead of using the current window if any. It might be a good idea to use the current window but indeed in this case, it should then be able to open a new tab without activating the browser's window.
You might want to ask for this behavior in either a bug report or a feature suggestion.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #251157 11/02/15 03:00 AM
Joined: Nov 2014
Posts: 79
N
Newbie Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Nov 2014
Posts: 79
Thanks!


Link Copied to Clipboard