Search code examples
tampermonkey

Why does a tampermonkey script for https://news.google.com/* appear in the menu for https://www.nytimes.com/?


I have a tampermonkey script with this header:

// ==UserScript==
// @name         Google News - Remove old articles
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Remove articles that already appeared recently
// @author       AC
// @require      http://code.jquery.com/jquery-latest.js
// @match        https://news.google.com/*
// @icon         https://www.google.com/s2/favicons?domain=google.com
// @grant        none
// ==/UserScript==

When I am on the page https://www.nytimes.com/ and I click on the tampermonkey icon in the Firefox toolbar, this script appears. Why?


Solution

  • Because the page contains an iframe, and that iframe links to news.google.com:

    enter image description here

    Userscripts run in iframes, and when they do, they get added to the Tampermonkey icon at the top.