ViolentMonkey script stopped working

  • 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; \
       }                                  \
    ');
    
Log in to reply
 

Looks like your connection to Opera forums was lost, please wait while we try to reconnect.