Web functionality?

Hi All,

Hope you're doing well.

Wondering if it's possible to open a webpage from within a game.

Thanks,

Jake
Use the script call:
window.open("https://www.w3schools.com");
Replace with the URL that you desire.
Use the script call:
window.open("https://www.w3schools.com");
Replace with the URL that you desire.
It opens a blank window. Do I need some headers or something? It's been a long time since I've done js. Do I need to do something with a plugin? Thanks!

script.png
Wow. That is strange. I just tried it here and it works just fine.
1587163369676.png


window.open("https://rakuenzero.itch.io/");
Did you get this working? I want to set up something similar where it loads a leaderboard webpage
window.open("url") works for me too :blink:
Did you get this working? I want to set up something similar where it loads a leaderboard webpage
You tried the command too, and like for me, it doesn't work?

Anyone please!

I tried taking the https:// out of it - so just www.google.com
When I do that, I no longer get a blank window. Instead, I get a Chrome extension error. See screenshot. Does MV use Chrome to open a webpage - or am I totally off here? Is there a plugin I need to import or install into MV, that will make it work? I'm running Windows 10. Firefox. But I also have Edge installed.
chrome.png


Here is my plugin folder. Almost empty, because I just started using MV. Please help!
plugins.png


This is all during Playtest. Does it only work for games after you do Deployment?

Thanks!!
Are you using the latest version of MV, 1.6.2 @jaketodd?
Are you using the latest version of MV, 1.6.2 @jaketodd?
Yes, I just bought it a few days ago.
That's strange, I can't get it to not work. Did you buy it on steam?
That's strange, I can't get it to not work. Did you buy it on steam?
I bought it at rpgmakerweb.com
Is there some trick for the event that triggers the script? I'm just using the basic event type where you double click on a square on the map, and then add the script text. Then at playtesting, I walk the character over to that part of the map, and a blank window pops up. Help!! Haha, I must sound a little funny, but I really want this to work. Is it possible to augment the starting menu (when you launch a game), so one of those choices launches a webpage?
Thanks!
Does MV use Chrome to open a webpage
The playtest from the editor runs in a chromium environment, because that was easiest to implement in the editor.
ALL MV-Games are running in a browser, because the games are HTML5-based. In every deployment, the exe (or whatever other program included) is nothing but a webbrowser to start the index.html that is the real game.

And to prevent path errors, the playtest redirects the chromium browser to a temporary path, that is why it went wrong after you removed the http from the adress.


Question: does the same happen if you start the index.html directly with firefox? Because there have been problems if Chrome was set to a high security option as in those cases both chrome and chromium prevent access to local files from any website (including local websites like the HTML5-game from MV)
Seems more likely than having to do with running it from steam or not. If it doesn't work from index.html, do you have a firewall that might block your game?

There's this plugin for a buck but I don't know whether it's also using window.open:
The playtest from the editor runs in a chromium environment, because that was easiest to implement in the editor.
ALL MV-Games are running in a browser, because the games are HTML5-based. In every deployment, the exe (or whatever other program included) is nothing but a webbrowser to start the index.html that is the real game.

And to prevent path errors, the playtest redirects the chromium browser to a temporary path, that is why it went wrong after you removed the http from the adress.


Question: does the same happen if you start the index.html directly with firefox? Because there have been problems if Chrome was set to a high security option as in those cases both chrome and chromium prevent access to local files from any website (including local websites like the HTML5-game from MV)
When I start it in Firefox, it gives me this error:

error.png

Thanks.

Seems more likely than having to do with running it from steam or not. If it doesn't work from index.html, do you have a firewall that might block your game?

There's this plugin for a buck but I don't know whether it's also using window.open:
Whatever Windows 10 does for that by default. Thanks.
I can open the index.html file fine in Microsoft Edge though, and the new window script works there too.
It does give that error. It's been a while since I started from index.html, maybe it doesn't work on the newer versions of firefox. I get the same error from a fresh project.

However the question remains why I can still use window.open just fine and you can't. Where do you store your project folder, in your documents?

Am I right that you don't have chrome installed? Neither do I.
It does give that error. It's been a while since I started from index.html, maybe it doesn't work on the newer versions of firefox. I get the same error from a fresh project.

However the question remains why I can still use window.open just fine and you can't. Where do you store your project folder, in your documents?

Am I right that you don't have chrome installed? Neither do I.
Yes, I store them in the Games folder in Documents. I don't have Chrome installed. What is this error you are getting, and how? Thanks.
I meant I also get "failed to load actors.json" when trying to run a project's index.html straight from firefox. I didn't used to but it must have been a firefox update I guess.

Okay I'm running out of guesses :LZSteary:
If you deploy a project, and try to open a website from the deployed project, does it still not work?
I meant I also get "failed to load actors.json" when trying to run a project's index.html straight from firefox. I didn't used to but it must have been a firefox update I guess.

Okay I'm running out of guesses :LZSteary:
If you deploy a project, and try to open a website from the deployed project, does it still not work?
Thank you, but I really don't want to have to deploy a project every time I test it.
@dwiseman57 Are you experiencing the same issue?

Original thread: https://forums.rpgmakerweb.com/threads/web-functionality.120295/