[PLUGIN] HTML | iFrame

0 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Good thanks!

    Most plugins are placed inside canvas but some are HTML elements.

    For an HTML element to appear it must be in front of the canvas, so it is not possible to place it in a 'background' layer because it is not inside the canvas.

    The only one that can override HTML is another HTML element.

  • Hi Nandynho!

    IT's pretty good that you continue the work of JesseJoh from his elements pack. I would recommend that you change the plugin ID though, because it conflicts with the old pack.

    I do have one question though... for some reason Apple decided that they don't follow the same rules for iframe as every other manufacturer or developer (what a surprise about this) so on Apple devices you cannot specify the size of the iframe unless it's LARGER than the document that is displayed inside. On Apple devices it will force the iframe to be the maximum size to contain the document... overflow:hidden does not work.

    After some research I have found something that (supposedly) works, but it's a bit of a hack. You have to make a DIV container around the iframe to force the size you want... basically using it like a wrapper. You set the heightt/width etc in the DIV wrapper and it will control the iframe sizing in iOS.

        <div id="wrapper">... old html goes here ...</div>
    I was wondering if it was possible to add this feature to the iframe plugin somehow, since it completely fails to display correctly in any Apple devices.
    There is also one last feature request if it's possible... Apple have also decided that disallowing ZOOM is discriminatory, so you can no longer force a particular display level. This is a problem however in a C2 app when it's using scaling mode (letterbox scale/integer scale/etc) because the ZOOM feature of the iframe over-rides the C2 scaling - and causes the entire page to break. I want to make the iframe itself not able to zoom in or out, and have a nested container inside of it that will allow zoom without affecting the entire project. I wish Apple would leave the evaluation of "discrimination" up to the designer, and not some random thought they had during their morning bowel movements.
    Is it possible to add to the plugin the turn off ZOOM of iframe (pinch/pull) on mobile devices (and CTRL+mouse scroll wheel) on PC/Windows?
    Thanks a bunch for reading! Great work on continuing the plugin!
  • Hi SoldjahBoy sorry for the loooooong delay.

    Putting the iframe inside a div in the current version is tricky as it opens up space for bugs.

    The current version is stable. If the community helps with testing then I can do this.

    First I need to test putting the iFrame inside a DIV:


    New Version 1.25 (Feb 11, 2017)

    • [?] Test iframe inside div
    • [+] Disable right click. *only works with HTML.

    New ID to differentiate with JesseJoh - Compatible with old projects

  • Hello.

    I can not open my projects because I have an error message telling me that I have to install "Plugin 'HTML | iFrame' by PlayLive".

    But it is already installed (following your updates).

    What should be done ?

    Thank you for your help.

  • christ59 I'm sorry for this, I did not expect anyone to download it for not having updated the homepage.

    I do not know if I will keep this update just to test how it works with IOS but I can not test it.

    They are not fundamental updates, only this should make a difference:


    Compatible with old projects

  • Thanks

  • Nandynho

    No problem at all. I know what it's like to be busy with other stuff. I appreciate if you have the time to look into this. The problem with iframe being forced to maximum document size on iDevices is quite annoying. I wish they would just do things like everyone else and make it easier on developers like you.



  • it's something wrong with Iframe object, i did this example:

    at start of layout iframe set url to "https://www.scirra.com/"

    iframe url is "https://www.scirra.com/" redirect to "https://www.facebook.com/Construct2/?fref=ts"

    i also tried the iframeinsertHTML and tried to compare two urls...

    but it doesn't recognise the url....... i want to do a redirection to another site if the typed url inside the iframe is allready present

  • Hi guys how are you?

    SoldjahBoy I really have several things to do mostly work. But put the iFrame inside a DIV to contain the size did not work? SoldjahBoy see this image, the iframe is inside a div.

    imothep85 I tested and did not see any errors but watch that some sites redirect to another page in the same domain, like google for example. To make a correct compare wait for full page load using 'On Load'.

    imothep85 see this same image, the initial url is 'https://www.google.com' but when it finishes loading it returns 'https://www.google.com.br/?gws_rd=cr&ei=...'.

    imothep85 the plugin returns the final URL after full page load and the HTML object does not work with URL so it will always return empty.


    New Version 1.26 (Feb 19, 2017)

    • [#] In this new version I realized that the DIV was receiving the same ID as the iFrame.

    Download - For compatibility error with old projects

  • do you have a capx example please?

  • Of course! See this simple capx and see if that's what you're trying to do: download

  • thanks it is possible to do this?

    i would like to check urls i have on a server in a txt file

    it is possible to check those urls BEFORE PAGE LOADING, and then if the user type one of those he get a redirection?

    i was thinking to ajax...

  • imothep85 this version in the moment you use 'Go to URL' will save the URL that was set but after the full load will get the final URL. *something very fast.


    New Version 1.27 (Feb 22, 2017)

    • [#] FIXED: 'backward', 'forward' and 'refresh'.
    • [+] ADD: Get URL at the moment it is Set.

    Download - For compatibility error with old projects - CAPX

  • the problem is, the page is still loaded, and AFTER the user is redirected.

    what i need is to do the redirection BEFORE the url/page is loaded

    also i tried something

    if the url is http://www.test.com/ i do a redirection to google, that works

    BUT if the url is http://www.test.com/something then teh user is no more redirected

    how to do a redirection if after teh backslash / the url contains folders or anything?

    i have a txt file on a server who contains hundreds of urls, what i want is this

    the app start with google search engine, the user do what he want, BUT if he try to reach one of those urls

    listed in the txt file, then he is redirected to google <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think I'm beginning to understand what you want. Please try this.


    New Version 1.28 (Feb 22, 2017)

    • [+] Get Host name.
    • [+] Get Path name.

    Download - For compatibility error with old projects - CAPX

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