buckwildn13 2 Posted October 7, 2014 Report Share Posted October 7, 2014 I am making a little app to browse a site but with radio support. So here is what I would like to do: User tunes to radio and it will be a hidden browser but I want them to have the ability to stop the radio. I know you can do this in the main page but is it possible to close the "in new browser" browser or is that not possible without a timer? If its possible could someone give me a little example of how I would accomplish this? TIA Quote Link to post Share on other sites
HaHaItsJake 25 Posted October 7, 2014 Report Share Posted October 7, 2014 What is your current set-up if you don't mind showing some of the coding so we can see how to implement the feature. If not, Is it Multi-threaded, Single Threaded? Would having the program turn the radio off in that browser or do you want it to close the whole page? Have you tried the Close Page Command within the thread, with a LoopWhile? Regards,HaHaItsJake Quote Link to post Share on other sites
HaHaItsJake 25 Posted October 7, 2014 Report Share Posted October 7, 2014 Here, Take a look at this, Let me know if it helps or not! ui button("Close Radio") { set(#Loop_While, "false", "Global") } in new browser { set(#Loop_While, "true", "Global") navigate("google.com", "Wait") comment("Other commands, login, channel, etc") loop while($comparison(#Loop_While, "=", "true")) { wait(1) } close page } Regards,HaHaItsJake Quote Link to post Share on other sites
buckwildn13 2 Posted October 7, 2014 Author Report Share Posted October 7, 2014 Naw its just a single thread its to join a chat and be able to listen to radio while your there but, the chat also has voice chat so the ability to close the radio would be nice to have the radio code is: define radioon { in new browser { navigate("http://usachatbuds.com/radio/", "Wait") wait(14400) }} Put the wait to keep the new browser from closing right away but would like to be able to close the new browser with a button if possible also don't have it hidden at the moment but would like to have it hidden in the end Quote Link to post Share on other sites
buckwildn13 2 Posted October 7, 2014 Author Report Share Posted October 7, 2014 I do believe that code will do what I need it to. Thanks for that Quote Link to post Share on other sites
HaHaItsJake 25 Posted October 8, 2014 Report Share Posted October 8, 2014 (edited) I do believe that code will do what I need it to. Thanks for that ui button("Close Radio") { set(#Loop_While, "false", "Global") } radioon() define radioon { in new browser { set(#Loop_While, "true", "Global") set user agent("Chrome") set visibility("Invisible") navigate("http://usachatbuds.com/radio/", "Wait") loop while($comparison(#Loop_While, "=", "true")) { wait(1) } close page } } There you go. Works perfectly for me. Regards, HaHaItsJake EDIT: Added in Visibility and User Agent. Edited October 8, 2014 by HaHaItsJake Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.