- fix redirecting on some systems

- more restrictive match rules, shouldn’t match anymore on Google Login (fix #314)
This commit is contained in:
Stefan Breunig
2013-02-26 07:40:12 +01:00
parent 4b3348e5d4
commit 9eef88673b

10
main.js
View File

@ -6,22 +6,24 @@
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js
// @description total conversion for the ingress intel map. // @description total conversion for the ingress intel map.
// @include *://www.ingress.com/intel* // @include http://www.ingress.com/intel*
// @match *://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
// REPLACE ORIG SITE /////////////////////////////////////////////////// // REPLACE ORIG SITE ///////////////////////////////////////////////////
if(document.getElementsByTagName('html')[0].getAttribute('itemscope') != null) if(document.getElementsByTagName('html')[0].getAttribute('itemscope') != null)
throw('Ingress Intel Website is down, not a userscript issue.'); throw('Ingress Intel Website is down, not a userscript issue.');
window.iitcBuildDate = '@@BUILDDATE@@'; window.iitcBuildDate = '@@BUILDDATE@@';
// disable vanilla JS // disable vanilla JS
window.onload = function() {}; window.onload = function() {};
if(window.location.protocol !== 'https:') { if(window.location.protocol !== 'https:') {
window.location.protocol = 'https:'; var redir = window.location.href.replace(/^http:/, 'https:');
window.location = redir;
throw('Need to load HTTPS version.'); throw('Need to load HTTPS version.');
} }