Version 1.8.4
- Force redirects only on main frames - Added google link fix script, to avoid the sub frame permission for force redirection on google
This commit is contained in:
		
							parent
							
								
									7ccd78ad39
								
							
						
					
					
						commit
						ad3ab8df07
					
				
							
								
								
									
										10
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| 
						 | 
					@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
 | 
				
			||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 | 
					The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 | 
				
			||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 | 
					and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.8.4] - 2019-09-26
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Compatibility note
 | 
				
			||||||
 | 
					- Require Firefox >= 55
 | 
				
			||||||
 | 
					- Require Chrome >= 22
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Changed
 | 
				
			||||||
 | 
					- Force redirects only on main frames
 | 
				
			||||||
 | 
					- Added google link fix script, to avoid the sub frame permission for force redirection on google
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.8.3] - 2019-09-23
 | 
					## [1.8.3] - 2019-09-23
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Compatibility note
 | 
					### Compatibility note
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,13 +39,16 @@
 | 
				
			||||||
        <div class="ui icon message" id="issue_253_test"></div>
 | 
					        <div class="ui icon message" id="issue_253_test"></div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <iframe src="https://kevinroebert.gitlab.io/ClearUrls/void/index.html?ref=gitlab"
 | 
					        <iframe src="https://kevinroebert.gitlab.io/ClearUrls/void/index.html?ref=gitlab"
 | 
				
			||||||
        height="0" width="0" id="void_roebert_eu_iframe" style="border:0; border:none;"></iframe>
 | 
					        height="1" width="1" id="void_roebert_eu_iframe" style="border:0; border:none;"></iframe>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <iframe src="https://youtube.com/redirect?q=https%3A%2F%2Fkevinroebert.gitlab.io%2FClearUrls%2Fvoid%2Findex.html%3Fref%3Dgitlab"
 | 
					        <iframe src="https://youtube.com/redirect?q=https%3A%2F%2Fkevinroebert.gitlab.io%2FClearUrls%2Fvoid%2Findex.html%3Fref%3Dgitlab"
 | 
				
			||||||
        height="0" width="0" id="redirect_roebert_eu_iframe" style="border:0; border:none;"></iframe>
 | 
					        height="1" width="1" id="redirect_roebert_eu_iframe" style="border:0; border:none;"></iframe>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <img id="i253_roebert_eu_img" height="0" width="0"/>
 | 
					        <iframe src="https://www.google.com/url?rct=j&url=https%3A%2F%2Fkevinroebert.gitlab.io%2FClearUrls%2Fi253.html"
 | 
				
			||||||
        <img id="block_roebert_eu_img" height="0" width="0"/>
 | 
					        height="1" width="1" id="i253_roebert_eu_iframe" style="border:0; border:none;"></iframe>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <img id="i253_roebert_eu_img" height="1" width="1"/>
 | 
				
			||||||
 | 
					        <img id="block_roebert_eu_img" height="1" width="1"/>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
 | 
					    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -630,11 +630,10 @@ function start()
 | 
				
			||||||
                    * Expand urls and bypass tracking.
 | 
					                    * Expand urls and bypass tracking.
 | 
				
			||||||
                    * Cancel the active request.
 | 
					                    * Cancel the active request.
 | 
				
			||||||
                    */
 | 
					                    */
 | 
				
			||||||
                    if(result.redirect &&
 | 
					                    if(result.redirect)
 | 
				
			||||||
                        (request.type === 'main_frame' ||
 | 
					 | 
				
			||||||
                        request.type === 'sub_frame'))
 | 
					 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                            if(providers[i].shouldForceRedirect() ) {
 | 
					                        if(providers[i].shouldForceRedirect() &&
 | 
				
			||||||
 | 
					                        request.type === 'main_frame') {
 | 
				
			||||||
                            browser.tabs.update(request.tabId, {url: result.url});
 | 
					                            browser.tabs.update(request.tabId, {url: result.url});
 | 
				
			||||||
                            return {cancel: true};
 | 
					                            return {cancel: true};
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										76
									
								
								core_js/google_link_fix.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								core_js/google_link_fix.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,76 @@
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					* ClearURLs
 | 
				
			||||||
 | 
					* Copyright (c) 2017-2019 Kevin Röbert
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					* it under the terms of the GNU Lesser General Public License as published by
 | 
				
			||||||
 | 
					* the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					* (at your option) any later version.
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					* but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
				
			||||||
 | 
					* GNU Lesser General Public License for more details.
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* You should have received a copy of the GNU Lesser General Public License
 | 
				
			||||||
 | 
					* along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					*
 | 
				
			||||||
 | 
					* Based on:
 | 
				
			||||||
 | 
					*   Remove Google Redirection
 | 
				
			||||||
 | 
					*   https://github.com/kodango/Remove-Google-Redirection/blob/master/extension/chrome/remove-google-redirection.user.js
 | 
				
			||||||
 | 
					*   Copyright (c) 2017 kodango
 | 
				
			||||||
 | 
					*   MIT License: https://github.com/kodango/Remove-Google-Redirection/blob/master/LICENSE
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					(function (window) {
 | 
				
			||||||
 | 
					    "use strict";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    function injectFunction(func) {
 | 
				
			||||||
 | 
					        var ele = document.createElement('script');
 | 
				
			||||||
 | 
					        var s = document.getElementsByTagName('script')[0];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ele.type = 'text/javascript';
 | 
				
			||||||
 | 
					        ele.textContent = '(' + func + ')();';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        s.parentNode.insertBefore(ele, s);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					    * Disable the url rewrite function
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					    function disableURLRewrite() {
 | 
				
			||||||
 | 
					        function inject_init() {
 | 
				
			||||||
 | 
					            /* Define the url rewrite function */
 | 
				
			||||||
 | 
					            Object.defineProperty(window, 'rwt', {
 | 
				
			||||||
 | 
					                value: function() { return true; },
 | 
				
			||||||
 | 
					                writable: false, // set the property to read-only
 | 
				
			||||||
 | 
					                configurable: false
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        injectFunction(inject_init);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					    * The main entry
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					    function main()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        disableURLRewrite();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        document.addEventListener('mouseover', function (event) {
 | 
				
			||||||
 | 
					            var a = event.target, depth = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            while (a && a.tagName != 'A' && depth-- > 0) {
 | 
				
			||||||
 | 
					                a = a.parentNode;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (a && a.tagName == 'A') {
 | 
				
			||||||
 | 
					                a.removeAttribute('onmousedown');
 | 
				
			||||||
 | 
					                var clone = a.cloneNode(true);
 | 
				
			||||||
 | 
					                a.parentNode.replaceChild(clone, a);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    main();
 | 
				
			||||||
 | 
					})(window);
 | 
				
			||||||
							
								
								
									
										106
									
								
								manifest.json
									
									
									
									
									
								
							
							
						
						
									
										106
									
								
								manifest.json
									
									
									
									
									
								
							| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    "manifest_version": 2,
 | 
					    "manifest_version": 2,
 | 
				
			||||||
    "name": "ClearURLs",
 | 
					    "name": "ClearURLs",
 | 
				
			||||||
    "version": "1.8.3",
 | 
					    "version": "1.8.4",
 | 
				
			||||||
    "author": "Kevin Röbert",
 | 
					    "author": "Kevin Röbert",
 | 
				
			||||||
    "description": "Remove tracking elements from URLs.",
 | 
					    "description": "Remove tracking elements from URLs.",
 | 
				
			||||||
    "homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",
 | 
					    "homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",
 | 
				
			||||||
| 
						 | 
					@ -75,9 +75,111 @@
 | 
				
			||||||
            "js": [
 | 
					            "js": [
 | 
				
			||||||
                "browser-polyfill.js"
 | 
					                "browser-polyfill.js"
 | 
				
			||||||
            ]
 | 
					            ]
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "all_frames": true,
 | 
				
			||||||
 | 
					            "matches": ["*://*.google.com/*", "*://*.google.ad/*",
 | 
				
			||||||
 | 
					                "*://*.google.ae/*", "*://*.google.com.af/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.ag/*", "*://*.google.com.ai/*",
 | 
				
			||||||
 | 
					                "*://*.google.al/*", "*://*.google.am/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.ao/*", "*://*.google.com.ar/*",
 | 
				
			||||||
 | 
					                "*://*.google.as/*", "*://*.google.at/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.au/*", "*://*.google.az/*",
 | 
				
			||||||
 | 
					                "*://*.google.ba/*", "*://*.google.com.bd/*",
 | 
				
			||||||
 | 
					                "*://*.google.be/*", "*://*.google.bf/*",
 | 
				
			||||||
 | 
					                "*://*.google.bg/*", "*://*.google.com.bh/*",
 | 
				
			||||||
 | 
					                "*://*.google.bi/*", "*://*.google.bj/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.bn/*", "*://*.google.com.bo/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.br/*", "*://*.google.bs/*",
 | 
				
			||||||
 | 
					                "*://*.google.bt/*", "*://*.google.co.bw/*",
 | 
				
			||||||
 | 
					                "*://*.google.by/*", "*://*.google.com.bz/*",
 | 
				
			||||||
 | 
					                "*://*.google.ca/*", "*://*.google.cd/*",
 | 
				
			||||||
 | 
					                "*://*.google.cf/*", "*://*.google.cg/*",
 | 
				
			||||||
 | 
					                "*://*.google.ch/*", "*://*.google.ci/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.ck/*", "*://*.google.cl/*",
 | 
				
			||||||
 | 
					                "*://*.google.cm/*", "*://*.google.cn/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.co/*", "*://*.google.co.cr/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.cu/*", "*://*.google.cv/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.cy/*", "*://*.google.cz/*",
 | 
				
			||||||
 | 
					                "*://*.google.de/*", "*://*.google.dj/*",
 | 
				
			||||||
 | 
					                "*://*.google.dk/*", "*://*.google.dm/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.do/*", "*://*.google.dz/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.ec/*", "*://*.google.ee/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.eg/*", "*://*.google.es/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.et/*", "*://*.google.fi/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.fj/*", "*://*.google.fm/*",
 | 
				
			||||||
 | 
					                "*://*.google.fr/*", "*://*.google.ga/*",
 | 
				
			||||||
 | 
					                "*://*.google.ge/*", "*://*.google.gg/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.gh/*", "*://*.google.com.gi/*",
 | 
				
			||||||
 | 
					                "*://*.google.gl/*", "*://*.google.gm/*",
 | 
				
			||||||
 | 
					                "*://*.google.gp/*", "*://*.google.gr/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.gt/*", "*://*.google.gy/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.hk/*", "*://*.google.hn/*",
 | 
				
			||||||
 | 
					                "*://*.google.hr/*", "*://*.google.ht/*",
 | 
				
			||||||
 | 
					                "*://*.google.hu/*", "*://*.google.co.id/*",
 | 
				
			||||||
 | 
					                "*://*.google.ie/*", "*://*.google.co.il/*",
 | 
				
			||||||
 | 
					                "*://*.google.im/*", "*://*.google.co.in/*",
 | 
				
			||||||
 | 
					                "*://*.google.iq/*", "*://*.google.is/*", "*://*.google.it/*",
 | 
				
			||||||
 | 
					                "*://*.google.je/*", "*://*.google.com.jm/*",
 | 
				
			||||||
 | 
					                "*://*.google.jo/*", "*://*.google.co.jp/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.ke/*", "*://*.google.com.kh/*",
 | 
				
			||||||
 | 
					                "*://*.google.ki/*", "*://*.google.kg/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.kr/*", "*://*.google.com.kw/*",
 | 
				
			||||||
 | 
					                "*://*.google.kz/*", "*://*.google.la/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.lb/*", "*://*.google.li/*",
 | 
				
			||||||
 | 
					                "*://*.google.lk/*", "*://*.google.co.ls/*",
 | 
				
			||||||
 | 
					                "*://*.google.lt/*", "*://*.google.lu/*", "*://*.google.lv/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.ly/*", "*://*.google.co.ma/*",
 | 
				
			||||||
 | 
					                "*://*.google.md/*", "*://*.google.me/*", "*://*.google.mg/*",
 | 
				
			||||||
 | 
					                "*://*.google.mk/*", "*://*.google.ml/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.mm/*", "*://*.google.mn/*",
 | 
				
			||||||
 | 
					                "*://*.google.ms/*", "*://*.google.com.mt/*",
 | 
				
			||||||
 | 
					                "*://*.google.mu/*", "*://*.google.mv/*", "*://*.google.mw/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.mx/*", "*://*.google.com.my/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.mz/*", "*://*.google.com.na/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.nf/*", "*://*.google.com.ng/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.ni/*", "*://*.google.ne/*",
 | 
				
			||||||
 | 
					                "*://*.google.nl/*", "*://*.google.no/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.np/*", "*://*.google.nr/*",
 | 
				
			||||||
 | 
					                "*://*.google.nu/*", "*://*.google.co.nz/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.om/*", "*://*.google.com.pa/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.pe/*", "*://*.google.com.pg/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.ph/*", "*://*.google.com.pk/*",
 | 
				
			||||||
 | 
					                "*://*.google.pl/*", "*://*.google.pn/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.pr/*", "*://*.google.ps/*",
 | 
				
			||||||
 | 
					                "*://*.google.pt/*", "*://*.google.com.py/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.qa/*", "*://*.google.ro/*",
 | 
				
			||||||
 | 
					                "*://*.google.ru/*", "*://*.google.rw/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.sa/*", "*://*.google.com.sb/*",
 | 
				
			||||||
 | 
					                "*://*.google.sc/*", "*://*.google.se/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.sg/*", "*://*.google.sh/*",
 | 
				
			||||||
 | 
					                "*://*.google.si/*", "*://*.google.sk/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.sl/*", "*://*.google.sn/*",
 | 
				
			||||||
 | 
					                "*://*.google.so/*", "*://*.google.sm/*",
 | 
				
			||||||
 | 
					                "*://*.google.sr/*", "*://*.google.st/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.sv/*", "*://*.google.td/*",
 | 
				
			||||||
 | 
					                "*://*.google.tg/*", "*://*.google.co.th/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.tj/*", "*://*.google.tk/*",
 | 
				
			||||||
 | 
					                "*://*.google.tl/*", "*://*.google.tm/*",
 | 
				
			||||||
 | 
					                "*://*.google.tn/*", "*://*.google.to/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.tr/*", "*://*.google.tt/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.tw/*", "*://*.google.co.tz/*",
 | 
				
			||||||
 | 
					                "*://*.google.com.ua/*", "*://*.google.co.ug/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.uk/*", "*://*.google.com.uy/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.uz/*", "*://*.google.com.vc/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.ve/*", "*://*.google.vg/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.vi/*", "*://*.google.com.vn/*",
 | 
				
			||||||
 | 
					                "*://*.google.vu/*", "*://*.google.ws/*",
 | 
				
			||||||
 | 
					                "*://*.google.rs/*", "*://*.google.co.za/*",
 | 
				
			||||||
 | 
					                "*://*.google.co.zm/*", "*://*.google.co.zw/*",
 | 
				
			||||||
 | 
					                "*://*.google.cat/*"],
 | 
				
			||||||
 | 
					                "js": [
 | 
				
			||||||
 | 
					                    "core_js/google_link_fix.js"
 | 
				
			||||||
 | 
					                ],
 | 
				
			||||||
 | 
					                "run_at": "document_end"
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "options_ui": {
 | 
					        "options_ui": {
 | 
				
			||||||
            "page": "html/settings.html"
 | 
					            "page": "html/settings.html"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
}
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user