[PLUGIN] HTML | iFrame

Post your completed addons to share with the community

Post » Thu Feb 23, 2017 7:31 am

it gives me an error i cant opent your capx file error in value not an expression hostname is not an expression or instance variable in iframe line 13, column 17 in event xml
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Thu Feb 23, 2017 3:31 pm

Did you download the new version?
Download - For compatibility error with old projects
Bitcoin Wallet: 1GCRqZExcP6svMdKGpCaRH4A8QAZtSjXxu
B
46
S
18
Posts: 204
Reputation: 3,668

Post » Thu Feb 23, 2017 5:05 pm

yeah :D now your last version works but still a problem, when i load the app i did this, added google.com at start
IF the user is visiting an url i want to be blocked, then he is redirected to google.com this actually works with your example
BUT what i need is to BLOCK acces to that specific url i dont want the user see the content :D

also like i said if the visited url is for example http://www.bad1.com i want blocked, it works, and im redirected to google
BUT if the url is http://www.bad1.com/something, the url is not more recognised and im not redirected to google.
im going to send you a PM :D

thanks for all your help :D
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Thu Feb 23, 2017 9:09 pm

if you can add the function for the iframe

Code: Select all
     block = true;
             }

             if (block) {
              //httpChannel.cancel(Cr.NS_BINDING_ABORTED); //this aborts the load
              httpChannel.redirectTo(Services.io.newURI('https://www.google.com/', null, null)); //can redirect with this line, if dont want to redirect and just block, then uncomment this line and comment out line above (line 17)
             }
            }


this come from my mozilla add-on

or maybe something like:

Code: Select all
};
function extract_domain(url)    {
    var matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
    return matches[1];
}
 
chrome.webRequest.onBeforeRequest.addListener(function(details) {
var domain = extract_domain(details.url);
return { cancel: AUTHORIZED_DOMAINS[domain ]===false };
}, {urls: ["<all_urls>"]},["blocking"]);})();
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Thu Feb 23, 2017 9:11 pm

the only function missing is in fact: onbefore loading
like that if the user types and url, who is blacklisted in a txt file for example, the page is not visible at all and the user is instantly redirected to google :D
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Fri Feb 24, 2017 1:40 am

Thanks for giving it a shot Nandynho... I'm not sure what the solution is - but you will be a complete hero if you can figure out how to force the size on Apple devices. It works perfectly on every other platform/format as it is now, but Apple are being horrid.

Thanks!
~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sun Feb 26, 2017 1:12 pm

hope to see some news :D
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Sun Feb 26, 2017 11:03 pm

@imothep85 try 'On Go to URL' with 'iFrame.Host'.
New Version 1.29 (Feb 26, 2017)
  • [+] On Go to URL *(triggered when a new page load starts).
  • [#] Get Host *(now returns only the hostname. eg: facebook, twitter, google...).
Download - For compatibility error with old projects - CAPX


@SoldjahBoy sorry man I do not find any discussion about this.
If you can give me some any discussion links about this to help me.
Bitcoin Wallet: 1GCRqZExcP6svMdKGpCaRH4A8QAZtSjXxu
B
46
S
18
Posts: 204
Reputation: 3,668

Post » Mon Feb 27, 2017 1:51 pm

ok i see, but maybe im explaining it wrong

what i want is this:

Image

when someone type something INSIDE THE IFRAME, for exampel here i typed cgtalk.com
i want the text_url copy exactly what the user typed and if it match an listed url, THEN he is directly redirected to google.com
your example works i get the redirecton if y type the url inside the text_url on top and if i hit the go buton.
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Mon Feb 27, 2017 3:52 pm

@imothep85 it's a google search, I can not block something that is off limits.
For you to block google search you must get what you typed, in this example 'cgtalk.com'.

This value is inside the query represented by 'q' (https://www.google.com/search?...q=cgtalk.com...).
Code: Select all
tokenat(tokenat(iFrame.URL, 1, "&q="), 0, "&")
~~~ in some cases ~~~
tokenat(tokenat(iFrame.URL, 1, "#q="), 0, "&")


But it is very simple to break this barrier, search for: 'icgtalk.com'
Bitcoin Wallet: 1GCRqZExcP6svMdKGpCaRH4A8QAZtSjXxu
B
46
S
18
Posts: 204
Reputation: 3,668

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest