Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I added a "When Clicked on this do something" behavior to a 2D overlay with a action of open a website. I typed the website URL and I left the target as "_blank" . But when I publish the app and click on the 2d overlay it does not open my browser or open any website. Note that I left the URL at http:// as said in CopperCube Documentation and my default browser is Mozilla Firefox |
||||
|
Coppercube's default inbuilt action for opening website doesn't works for the windows platfrom. You can download my extension that does the same job and works on both windows and webGL target. You can download the extension from neophyte.cf https://neophyte.cf/ccb_action_o... hope that helps ![]() |
||||
|
@just_in_case I downloaded the action from neophyte.cf and used it in CopperCube but its still not working, nothing happens when I click the 2D overlay. It doesn't open Chrome at all when I click the 2D overlay. |
||||
|
Hi @dynamogames Are you on Windows? Have you specified the url with protocol i.e. http://yoursite or https://yoursite. If you're not specifying a protocol it will open a file explorer instead of browser. You can also try the following: https://www.howtogeek.com/689159/how-to-open-mozilla-firefox-using-command-prompt-on-windows-10/ and tell if it's possible to open FF that way. In case it is you should use system function: https://www.ambiera.com/coppercube/doc/cnt_javascriptref.htmlsystem. I guess you can just modify just_in_case's script. Please also notice that not everyone have ff installed, so you should consider using a general approach. |
||||
|
@okeoke Yes I use windows. The website is https:// |
||||
|
I was able to open Firefox and the website using Command Prompt. @okeoke when I press the 2D overlay nothing happens at all. Neither Browser nor File Explorer opens. |
||||
|
Try opening cmd and execute "explorer https://google.com" 1. Click on win key; 2. Type cmd to search for command line; 3. Press enter - or click on cmd icon. command line should open; 4. Type in "explorer https://google.com" without quotes; 5. Press enter google.com should be opened. if it is you it means you configured the extension incorrectly. If no probably you don't have a default browser set in the system. You can also try "start firefox https://google.com" - in case this works you need to modify the script. |
||||
|
https://www.ambiera.com/coppercube/doc/cnt_javascriptref.htmlsystem. - this link is giving an error 404 (not found) |
||||
|
The "explorer https://google.com" didn't work in Cmd but "start Firefox https://google.com" worked. So how do I modify the script? |
||||
|
Look at the line 42 it should say: system("explorer "+this.Website,true); replace "explorer " with "start firefox ". Make sure it ends with a space. it concatenates the strings, so if there is no space you'll get "start firefoxhttps://google.com" as a result. Also notice it will only work if firefox is installed, so if it works on your pc, doesn't mean it will work everywhere. Probably, there should be a more generic solution. Maybe it's possible to check what browsers are installed using bat script for ex. |
||||
|
@okeoke I can't find the script, the link u provided above gives an error 404, how do I did the script? |
||||
|
I'm talking about the script just_in_case's site: https://neophyte.cf/ccb_action_open_a_website.html. |
||||
|
Thanks @okeoke and @just_in_case I've been as to get it. Thanks so much for your contributions. |
||||
|
well, my script is supposed to open whatever default browser your computer has, but anyways I am glad that it worked for you in the end. :) |
|