question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the problem?

my script does not run and it give me this message “Sub-frames only scripts: 1”

How to reproduce it?

  1. create a new script
  2. paste this
// ==UserScript==
// @name        Google Tweak
// @namespace   local.google
// @match       *://*google.com/*
// @grant       none
// @version     1.0
// @run-at      document-idle
// @author      bokunocode
// ==/UserScript==
;
(function() {
  'use strict';
  document.querySelectorAll("a").forEach(function(a) {
    a.onmousedown = null;
    a.onclick = null;
    console.log(a)
  });
});
  1. toggle script on and off, refresh the page.

What is the expected result?

event on all a elements, removed.

What is the actual result?

nothing happen,

What is the result in the upcoming release?

i’ve tried both stable and beta from chrome web store

Environment

  • Browser: Opera
  • Browser version: Opera 77.0.4054.277
  • Violentmonkey version: Version 2.12.14.1
  • OS: Linux Arch

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tophfcommented, Aug 3, 2021

We don’t write anything to that console normally because most users have no idea how to access it. You can compile a debug build from source and there will be many messages there. However, Violentmonkey doesn’t inject its scripts explicitly when using the default (page) mode (more info), it’s only for the content mode that you will see an error there when injection fails.

Anyway, the next version tests injectability in the popup and displays the message accordingly.

0reactions
bokunodevcommented, Aug 3, 2021

@tophf

Violentmonkey can’t write to the console of such tabs.

not in console of current tab. in debug console. open this in firefox about:debugging#/runtime/this-firefox

because I just faced some weird behaviour. i’m not sure its either failed to inject or the script is faulty. i tried to make a script with setTimeout and it does not run at all. violetmonkey also didn’t log anything. i’m confused. i can provide some screenshot if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - JS script not running? - Stack Overflow
The script requires jQuery. The variables with $ are trying to create jQuery objects from the selector that is passed as ...
Read more >
Don't know why the script is not running - JavaScript
I have tried to open it as a local file instead with Chrome, but still didnt work. Can someone tell me why is...
Read more >
A script takes too long to run or is not responding - IBM
A script takes too long to run or is not responding. When using z/OSMF, you might encounter the long-running script dialog, which means...
Read more >
Why does the RUN button not work for my script? - MathWorks
The 'Run' button is green, and presses down like normal, but the script does not execute. Running the code line-by-line works fine, and...
Read more >
I am getting an error that I should not run script as root
Look, you are signed in as the root user: root@levono. Type sudo su YOURUSERNAME it will be changed to. YOURUSERNAME@levono. then execute ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found