Browser "GoToURL" ->window.top.location

Discussion and feedback on Construct 2

Post » Tue May 13, 2014 2:18 pm

Hi @Ashley

I found one sponsor that requesting that the game is open in window.top.location and not window.location

"Notice: The games are loaded inside an iframe, so the link must be opened in the top window. If you are using a HTML link, please add the attribute target="_top". When using javascript to open the link, use window.top.location.href (and not window.location.href)"

When I looked at the Browser plugin I found out that the plugin codes for GoToURL is this
Acts.prototype.GoToURL = function (url)
{
if (this.runtime.isCocoonJs)
CocoonJS["App"]["openURL"](url);
else if (this.runtime.isEjecta)
ejecta["openURL"](url);
else if (this.runtime.isWinJS)
Windows["System"]["Launcher"]["launchUriAsync"](new Windows["Foundation"]["Uri"](url));
else if (!this.is_arcade && !this.runtime.isDomFree)
window.location = url;
};

Maybe we can add another parameter or option to the function like "top" or "normal" ?

Right now I have to use Browser execute Javascript to solve this problem and I heard that some of the Construct 2 users are rejected or having problem with this Sponsor. Unless they use DOM or Browser execute Javascript.

Hopefully this feature can be added in next release?
B
79
S
22
G
14
Posts: 389
Reputation: 12,324

Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot], sunisa2532, zenox98 and 23 guests