[PLUGIN] iframe filter

Post your completed addons to share with the community

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

Post » Tue Apr 05, 2016 1:11 pm

@Braus

For example, your URL of main frame is https:\\www.yourwebsite.com\xxxx...
Then you might try
find( MainFrameURL, "www.yourwebsite.com")

If MainFrameURL does not contain "www.yourwebsite.com", the find expression will return -1.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Tue Apr 05, 2016 1:34 pm

Ok. And how can I use it with the iframe filter?

start of layout
iframefilter inframe
iframe filter.MainFrameURL = "https:\\www.yourwebsite.com\xxxx..."
find(MainFrameURL, "www.yourwebsite.com") : go to layout 1

else : go to layout 2
B
4
Posts: 96
Reputation: 392

Post » Tue Apr 05, 2016 5:37 pm

@Braus

Sorry, I tested the main frame after exported, only in preview situation will get a correct MainFrameURL, otherwise I get "".
The solution might be failed, this iframe filter only could check if current frame is in iframe or not.
I will try to find another way to solve this issue.


The checking of iframe still works, and the redirection of main frame works well, too. But expression:MainFrameURL failed.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Tue Apr 05, 2016 7:11 pm

Ok. Thanks anyway.
B
4
Posts: 96
Reputation: 392

Post » Wed Apr 06, 2016 12:23 pm

@rexrainbow: What do you think about this solution?

- iframe filter to check if the game is within a iframe + browser.pathname to restrict the game opens only if the relative path is what I have determined instead to control the url

If someone want to insert my game within a iframe, he will need to use the whole address instead the path only, right?
B
4
Posts: 96
Reputation: 392

Post » Thu Apr 07, 2016 1:25 am

@Braus

You could try, but I guess it will be failed.
Because the application in iframe does not know the url of main frame, and the url of application is not hard to pick, imo.

Here is another plugin which can send message between main frame and iframe, or between iframes. I will use this plugin to check if the main frame is my page. I will do it in the weekend.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Sun Apr 10, 2016 10:35 am

@Braus

I had made a solution to to recognize the main frame.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Previous

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests