Include all pages in tampermonkey(userscript)

user1972757 picture user1972757 · Mar 18, 2013 · Viewed 35.7k times · Source

I have to include all sites in tampermonkey..this is the script that i have to run

// ==UserScript==
// @name       Phishing Blockz
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @description Phishing block based on hyperlinks
// @match      http://*/*
// @run-at     document-end

var req = new XMLHttpRequest();
req.open('GET', document.location, false);
req.send(null);
var headers = req.status;
var locheader=req.getResponseHeader("Location");
alert(headers);
alert(locheader);

Have I done something wrong.please help me to run this userscript in all pages in chrome

Answer

Richard Plester picture Richard Plester · Apr 2, 2013
// @match      http://*/*

will only match addresses starting with http://... but not https://... for example.

Use the following to include all addresses if that's what you really require (including local pages you may have saved on your hard-drive!)..

// @match      *://*/*

Note: The method below also works at the time of writing by virtue of a potential bug or undocumented feature in TM2.12 (so could well be subject to change in future versions!!):

// @match      *