Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Website Action in CopperCube

dynamogames
Registered User
Quote
2022-08-01 02:49:06

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


just_in_case
Moderator
Quote
2022-08-01 11:35:58

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


dynamogames
Registered User
Quote
2022-08-01 14:12:40

@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.


okeoke
Registered User
Quote
2022-08-01 14:42:29

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.


dynamogames
Registered User
Quote
2022-08-01 15:27:28

@okeoke Yes I use windows. The website is https://


dynamogames
Registered User
Quote
2022-08-01 15:38:14

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.


okeoke
Registered User
Quote
2022-08-01 15:41:56

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.


dynamogames
Registered User
Quote
2022-08-01 15:42:19

https://www.ambiera.com/coppercube/doc/cnt_javascriptref.htmlsystem. - this link is giving an error 404 (not found)


dynamogames
Registered User
Quote
2022-08-01 15:46:53

The "explorer https://google.com" didn't work in Cmd but "start Firefox https://google.com" worked.
So how do I modify the script?


okeoke
Registered User
Quote
2022-08-01 16:11:27

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.


dynamogames
Registered User
Quote
2022-08-01 16:21:55

@okeoke I can't find the script, the link u provided above gives an error 404, how do I did the script?


okeoke
Registered User
Quote
2022-08-01 16:24:53

I'm talking about the script just_in_case's site: https://neophyte.cf/ccb_action_open_a_website.html.


dynamogames
Registered User
Quote
2022-08-01 16:53:04

Thanks @okeoke and @just_in_case I've been as to get it. Thanks so much for your contributions.


just_in_case
Moderator
Quote
2022-08-02 08:13:42

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. :)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact