[PLUGIN] iframe filter

Post your completed addons to share with the community

Post » Mon Apr 04, 2016 10:00 am

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?
B
4
Posts: 96
Reputation: 392

Post » Mon Apr 04, 2016 3:42 pm

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.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Mon Apr 04, 2016 6:45 pm

@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.
B
4
Posts: 96
Reputation: 392

Post » Tue Apr 05, 2016 8:05 am

@Braus

System comparing will test if all characters of two strings is equal or not. Or you might try system expression:
Code: Select all
find(src, text), Find the first index within src that text occurs, else returns -1. find is case-insensitive
. 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.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Tue Apr 05, 2016 10:10 am

rexrainbow wrote:@Braus

System comparing will test if all characters of two strings is equal or not. Or you might try system expression:
Code: Select all
find(src, text), Find the first index within src that text occurs, else returns -1. find is case-insensitive
. 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?
B
4
Posts: 96
Reputation: 392

Post » Tue Apr 05, 2016 10:31 am

@Braus

You only need provide part of url string if using "system expression:find".
If someone embeds your application into an iframe, the expression:MainFrameURL will return different value, unless he embeds your main frame into his iframe ->
His main frame - iframe ( your main frame ) - iframe ( your application ).
I guess that the expression:MainFrameURL will still return your main frame's URL.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Tue Apr 05, 2016 11:09 am

rexrainbow wrote:@Braus

You only need provide part of url string if using "system expression:find".


Sorry, but I don't know how the "find" expression works. I didn't find any example about it in the manual.

Could you provide a simple example here (it's not necessary a capx)
B
4
Posts: 96
Reputation: 392

Post » Tue Apr 05, 2016 12:01 pm

@rexrainbow: Thanks for the example. Unfortunately I cannot send you a PM for while.

In your example you didn't use the iframe filter. Why?

In this same example, what's specifically is SRC and what is TARGET?
B
4
Posts: 96
Reputation: 392

Post » Tue Apr 05, 2016 12:05 pm

@Braus

The example only focus on "how to use system expression: find", that why I do not use iframe.
SRC is the MainFrameURL , TARGET is the url you allow.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Tue Apr 05, 2016 12:35 pm

rexrainbow wrote:@Braus

The example only focus on "how to use system expression: find", that why I do not use iframe.
SRC is the MainFrameURL , TARGET is the url you allow.



But how can I check the TARGET if I've only the MainFrameURL expression in the iframe filter plugin? (Sorry, I'm not so clever :oops: )
B
4
Posts: 96
Reputation: 392

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests