Skip to content

[BUG] setTimeout error #2392

@eight04

Description

@eight04

Sequence of actions:

  1. Install this script:
    // ==UserScript==
    // @name        New script uindex.org
    // @namespace   Violentmonkey Scripts
    // @match       https://uindex.org/details.php*
    // @grant       GM_setValue
    // @version     1.0
    // @author      -
    // @description 12/2/2025, 2:43:03 PM
    // ==/UserScript==
    
    setTimeout(() => console.log("test"));
    @grant is required.
  2. Visit https://uindex.org/details.php?id=19569816
  3. Check the console log.

Problem:

14:44:05.509 TypeError: 'setTimeout' called on an object that does not implement interface Window.
    VMsssov8pd4e1brwina8eg moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/ New script uindex.org.user.js#116:11
    VMsssov8pd4e1brwina8eg moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/ New script uindex.org.user.js#116:12
    rn moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/sandbox/injected-web.js:1
    <anonymous> moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/ New script uindex.org.user.js#116:1
    Le moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/sandbox/injected-web.js:1
    post moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/sandbox/injected-web.js:1
    ScriptData moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/sandbox/injected-web.js:1
    onHandle moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/sandbox/injected-web.js:1
    je moz-extension://e02c7e40-1e35-4ca5-aaf0-03db65a97847/sandbox/injected-web.js:1
New script uindex.org.user.js:12:37

Expected result:

With @grant none, the script runs correctly.

Devtools console contents:

Environment:

  • OS: Windows 10
  • Browser: Firefox Nightly 147.0a1
  • Violentmonkey Version: 2.31.0

Ref: https://greasyfork.org/zh-TW/scripts/4255-linkify-plus-plus/discussions/315982

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions