0

I want to make a script for Google pages like: chrome://apps/

But seems that Tampermonkey doesn't work on these pages. What should I do for the following script?

What I'm trying:

// ==UserScript==
// @name         Some Script
// @namespace    http://tampermonkey.net/
// @version      0
// @description  Trying to work in Google pages
// @author       You
// @match        *://*/*
// @grant        none
// ==/UserScript==

var myVar = 0;

if(window.location.href === "chrome://apps/"){ //check the URL
    if(myVar === 0){
        myVar++;
    alert("test");
    }
}
Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Luís HNrique
  • 216
  • 1
  • 14

1 Answers1

2

Chrome Extensions (and therefore Tampermonkey) aren't able to run on any pages that start with chrome.

Host permissions and content script matching are based on a set of URLs defined by match patterns. A match pattern is essentially a URL that begins with a permitted scheme (http, https, file, or ftp, and that can contain '*' characters.

Source

Chrome would not be a nice place if extensions/scripts could willfully mess with settings or install extensions.

Sean Breckenridge
  • 1,932
  • 16
  • 26