[PLUGIN] iframe filter

1 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Check if current page is in an iframe or not

    iframe filter, plugin and sample capx are included.

    Demo-

    User could try to embed this page into an iframe. The URL of main page will be redirected to this page back.

  • Nice plugin !

    (And you are very fast to integrate all this in a nice package, you know ! <img src="smileys/smiley1.gif" border="0" align="middle" />)

  • Update:

    Change category to "Web".

  • Update:

    Add version to 0.8

  • Hi

    Can I use this plugin with the newer C2 version? My game is in an iframe but in the same domain and I don't want the game can be open in iframes in others domains, this plugin will work for me?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Braus

    Here is a sample capx, the "Condition:Is acceptable" will return true if current app is not in any iframe ( I had set property "Busting all iframes" to "Yes" ).

    The exported html5 page is here, you might try open this page directly, or try to put it into a iframe ( Pode has a iframe plugin ), and see the result.

    But this is not a perfect solution, because that the game has been downloaded already.

  • Nice! But I can use in my own iframe? To solve the previous downloads issue I can use any command to clean the cache or something else?

  • Braus

    Call "Action:Append" to add your url of acceptable page.

    About download issue, I guess that there is not command to force cleaning cache.

    But it is not my consideration, it is better to ban the player before download the game. (I don't know how to do)

  • rexrainbow: Thanks. Even using an iframe I need to set "Busting all iframes" to yes?

    Nedd I to include the append action the URL (h t t p: / / w w w . domain . com") or the entire path (h t t p : / / w w w . domain . com / folder / page)?

  • Braus

    I had updated the document of this plugin in this page.

    Property "Busting all iframes" had been removed.

  • Ok. Thanks for the news, but I still didn't understand if I've to use only the URL or the whole path in the append action.

    Do you know how to prevent the game to open out of the iframe? I don't know if it was clear, but I need to avoid that anyone can access the game out of my website. Is it possible?

  • Update

    "condition:Is in acceptable iframe", "Action: Append" had been deprecated.

    Add new "Condition:Is in iframe" and "Expression:MainFrameURL" -

    "Condition:Is in iframe" will return true if current application is embedded into an iframe, get URL of main frame by "Expression:MainFrameURL".

    Braus

    Hope this changing will be more easy to use. First you detect if the application is in an iframe or not. Redirection url of main frame if application is in an iframe.

  • rexrainbow: Interesting changes. It's now more intuitive.

    Please, check below if I did it right:

    Conditions:

    On start of layout

    iframeFilter is in iframe

    iframeFilter.MainFrameURL = "http://www.website.com" (I didn't include the whole path. Need I?): go to layout 1

    else: go to layout2

    Edited: It does not work, always shows the layout2. The URL of my iframe is created by the wordpress. Something like: "www.website.com/?game=game1" and the game is in the hdgames folder. I'll waiting for your instructions.

  • Braus

    System comparing will test if all characters of two strings is equal or not. Or you might try system expression:

    find(src, text), Find the first index within src that text occurs, else returns -1. find is case-insensitive[/code:100k9xa7]. see official manual.
    Before you compare the URL, you might print it on a text object or a console of browser, to make sure your logic or my plugin is correct.
  • Braus

    System comparing will test if all characters of two strings is equal or not. Or you might try system expression:

    find(src, text), Find the first index within src that text occurs, else returns -1. find is case-insensitive[/code:eg0w63iv]. see official manual.
    Before you compare the URL, you might print it on a text object or a console of browser, to make sure your logic or my plugin is correct.
    

    Actually my doubt is about the correct path of the main frame. Need I to include "http://" and the whole path where's the main frame or where is the game? In this case, if someone do the same, opening the address within an iframe, will succeed?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)