Detect if the output is opened in an iframe Pano2VR 7

Post Reply
User avatar
Hopki
Gnome
Posts: 12999
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Following a support e-mail please find attached a component that detects if the output is opened in an iframe or not.

iframe.gif
iframe.gif (1.79 MiB) Viewed 41581 times

The component adds a variable to the skin, in_iframe, which is set to false and a Code Element which has the required code needed.
When the component is added to a skin and then the output is opened in an iframe the variable value will change to true.

The variable can then be used in many ways using logic blocks, it can be used to hide and show skin elements or even using a Variable Changed source action to trigger events.

To add to Pano2VR, first download the component,

detect_opened_n_iframe_v7.ggskc
(889.56 KiB) Downloaded 576 times

Then double-click the component to add it to Pano2VR's component toolbox, the default category will be User-Defined or you can create a new category.
To use the component simply double-click the component in the components toolbox to add it to your skin.

1.png
1.png (70.99 KiB) Viewed 41581 times

When the component is added the skin will have a new variable, in_iframe.

2.png
2.png (27.06 KiB) Viewed 41581 times

The variable value will be false.
You can now use this variable in a logic block or Variable Changed source action to trigger an event.

In the attached project the variable is used in a visible logic block in a screen tint rectangle and a text box.

test_project.zip
(14.55 KiB) Downloaded 512 times

To test the component in the project please see this video

The video shows how to use the built-in web server to open the iframe.html page that has an iframe and then it shows opening the index.html page.
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Post Reply