• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    ViolentMonkey script stopped working

    Opera add-ons
    1
    1
    1364
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User
      A Former User last edited by

      Today, a script in Violentmonkey just stopped working. It was fine before. What is going on? The script is one that I borrowed and modified to create a content stylesheet to modify certain elements on web pages. The links no longer change colour the way they did before. This is the script:

      // ==UserScript==
      // @name     Content-style
      // @namespace Violentmonkey Scripts
      // @include  *
      // @grant none
      // ==/UserScript==
      function addCss(cssString) {
          var newCss = document.createElement('style');
          newCss.type = "text/css";
          newCss.innerHTML = cssString;
          document.getElementsByTagName('head')[0].appendChild(newCss);
          console.log("appended css");
      }
      
      addCss (
        'a[href^="javascript:"] {                                            \
           color: #006000 !important; background-color: #FFD8D8 !important;  \
           background-image: none !important;                                \
         }                                                                   \
         a:visited {                             \
         	 color: #AA00AA !important;            \
           background-color: #FFFFB0 !important; \
           background-image: none !important;    \
         }                                       \
         a:hover {                            \
           color: #E00000 !important;         \
           background-color: #A0FFFF;         \
           background-image: none !important; \
         }                                    \
         :link[target="_blank"], :visited[target="_blank"],\
         :link[target="_new"],   :visited[target="_new"] { \
         cursor:  crosshair;                               \
         }                                                 \
         p {user-select: text !important;   \
         }                                  \
         div.back2top {height: auto !important; \
         }                                      \
         canvas {                           \
           border: 4px solid red!important; \
         }                                  \
      ');
      
      Reply Quote 0
        1 Reply Last reply
      • First post
        Last post

      Computer browsers

      • Opera for Windows
      • Opera for Mac
      • Opera for Linux
      • Opera beta version
      • Opera USB

      Mobile browsers

      • Opera for Android
      • Opera Mini
      • Opera Touch
      • Opera for basic phones

      • Add-ons
      • Opera account
      • Wallpapers
      • Opera Ads

      • Help & support
      • Opera blogs
      • Opera forums
      • Dev.Opera

      • Security
      • Privacy
      • Cookies Policy
      • EULA
      • Terms of Service

      • About Opera
      • Press info
      • Jobs
      • Investors
      • Become a partner
      • Contact us

      Follow Opera

      • Opera - Facebook
      • Opera - Twitter
      • Opera - YouTube
      • Opera - LinkedIn
      • Opera - Instagram

      © Opera Software 1995-2025