Red warning message in Opera console
Asked Answered
T

3

53

Red-colored message appeared, presumably after browser auto-update:

devtools console red message

Warning!

This area is for use by developers only. Scammers have been known to encourage people to copy/paste information here to hack accounts. Do not proceed if you are unsure.

The browser is Opera 87.0.4390.36. It seems it doesn't apply to Chrome/Chromium but this needs to be confirmed. The relevant user agent part is:

AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36 OPR/87.0.4390.36

On smaller screens it steals the space to the point console tab becomes much less usable.

I see no settings in devtools preferences that could turn it off. Is there a way I can disable this message locally without downgrading the browser?

UPD: It arrived in Opera 87, the changelog is currently available in cache only. It's a known issue and may take some time and user activity for the company to realize the consequences. Still, a quick fix for the problem would be highly appreciated.

Taunt answered 1/6, 2022 at 12:48 Comment(5)
Maybe it's something in chrome://flags. Also, try asking in an opera forum if they have one.Drennen
This is so annoying. Cant find anything how to turn off. My screen already don't have space.Octosyllabic
I just noticed this today, too. Maybe new in Opera 87?Coleridge
What next a warning every time you make a payment? Really so annyoying. Devs need to enable a toggle to turn it off - at a push show it once on browser launch, but really I don't appreciate this nannyDerm
@SolaceBeforeDawn, it would be interesting to know the number of scams done via web console. Is there a javascript pandemic going on with web users?, I've never heard about it... Sounds exciting!Johnsson
C
21

Do the following steps, they are very easy and you can remove the red console warning.

This answer will allow Opera to continue to be updated (good for security).

Bookmark this question since you may have to restart your browser multiple times.

Also, open this question in another browser eg Firefox, Edge or Chrome.

https://mcmap.net/q/338786/-red-warning-message-in-opera-console/72485455

Create a folder called: kill_opera_console_warning

  • Anywhere is ok (same drive where Opera is installed with admin permissions is best)

Create the following files directly inside the folder.

manifest.json

{
  "manifest_version"    :  3

, "name"                :  "AAA: Kill Opera Console Warning"
, "description"         :  "..."
, "version"             :  "1.0"

, "devtools_page"       :  "devtools_page.html"

// no permissions required
, "permissions"         :  [ ]

, "content_scripts"     :
    [
        {
          "js"          :  [ "inject_into_devtools.js" ]
        , "matches"     :  [ "<all_urls>" ]
        }
    ]

// Same key as kgejglhpjiefppelpmljglcjbhoiplfn (ChromeVox)
// see : https://mcmap.net/q/151677/-how-to-inject-javascript-into-chrome-devtools-itself/17044405#17044405
, "key"                 :   "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEGBi/oD7Yl/Y16w3+gee/95/EUpRZ2U6c+8orV5ei+3CRsBsoXI/DPGBauZ3rWQ47aQnfoG00sXigFdJA2NhNK9OgmRA2evnsRRbjYm2BG1twpaLsgQPPus3PyczbDCvhFu8k24wzFyEtxLrfxAGBseBPb9QrCz7B4k2QgxD/CwIDAQAB"
}

devtools_page.html

<html>
<head></head>
<body><script src="devtools_page_helper.js"></script></body>
</html>

devtools_page_helper.js

const devtools_custom_css_G = `.console-view > div[class^="console-warning-" i] { display : none ; }` ;

chrome.devtools.panels.applyStyleSheet( devtools_custom_css_G ) ;

inject_into_devtools.js

if  (   /^(?:chrome-|opera-)?devtools:$/gi.test( window.location.protocol ) === true   )
    {
    var red_console_warning__kill_GO = function red_console_warning__kill_TO( run_count_F = 0 )
        {
        if  (   run_count_F > 20   )   {   return ;   }
        
        var devtools_custom_css_selector_T = ".console-view > div[class^='console-warning-' i]" ;
            
        var garbage_TA = document.querySelectorAll( devtools_custom_css_selector_T ) ;
        
        for (   let one_piece_of_garbage_TH  of  garbage_TA   )
            {
            one_piece_of_garbage_TH.style.setProperty( "display" , "none" , "important" ) ;
            }
            
        if  (   garbage_TA.length > 0   )   {   return ;   }
            
        setTimeout( red_console_warning__kill_TO.bind( null , run_count_F+1 ) , 500 ) ;
        } ;

    red_console_warning__kill_GO( 0 ) ;
    }

You should now have the following file structure:

- kill_opera_console_warning
--- manifest.json
--- devtools_page.html
--- devtools_page_helper.js
--- inject_into_devtools.js

NOW ADD THE EXTENSION YOU JUST CREATED TO OPERA

  1. Open a new tab and go to: "opera://extensions"

  2. "Developer mode" should be enabled (top_right_corner)

  3. Click on the "Load unpacked" button (near top_left_corner)

  4. A file picker should appear, go find the "kill_opera_console_warning" folder

  5. Go inside the folder, click "Select Folder"

  6. Your extension should load.

  7. Go through your extensions and find "AAA: Kill Opera Console Warning"

  8. Tick the "Allow in Incognito" checkbox

  9. Tick the "Allow access to search page results" checkbox


LASTLY WE CHANGE ONE SETTING IN DEVTOOLS, RESTART OPERA AND THEN TEST IT

At this point if you refresh the DevTools it will appear the extension you created is working and the problem is solved. This extension uses two methods, one is a hack and the other is more robust. The hack will stop working one day. The robust method requires a setting to be changed.

  1. Close all instances of DevTools that you have open.

  2. Open a new normal window (not an incognito window).

  3. Go to "about:blank"

  4. Open DevTools (Ctrl+Shift+I)

  5. Press F1 to open the PROPER settings

  6. There should now be an enormous amount of settings with checkboxes

  7. Click on the "Experiments" tab (top_left_corner with the word "Settings" nearby)

  8. Tick the checkbox for "Allow extensions to load custom stylesheets" so that it is ENABLED. Probably the first checkbox at the very start of the list. (If it is not the first checkbox then use the search box with the word "Filter" next to it. Type in "stylesheets".)

  9. Close the settings and close the DevTools. Exit Opera so that all windows are closed.

  10. Wait 5 seconds and restart Opera.

  11. Open a new window

  12. Go to "about:blank"

  13. Open DevTools (Ctrl+Shift+I)

  14. Go to Console tab.

  15. You may see the red warning briefly for half a second but it should disappear. If you do not see it, congratulations!

  16. If you still see the warning OR it comes back then "Allow extensions to load custom stylesheets" has probably DISABLED itself.

  17. Go back to step 6 of these instructions and make sure the checkbox is enabled. If it has DISABLED itself, then you will need to ENABLE it again and go through all the instructions from step 6-19 again. It may require a few tries (browser restarts) to get it to stick.


STILL NOT WORKING

If the checkbox stays ENABLED after browser resets but you are still seeing the red warning then maybe start over (remove extension, delete files) then repeat all steps from the beginning in case you made an error.

If you are sure you have followed the instructions exactly then you may have to play around with them a little but they definitely do work so long as the extension is installed properly and you manage to get ""Allow extensions to load custom stylesheets" to stay ENABLED.


ONLY READ PAST HERE IF YOU ARE A STACKOVERFLOW EDITOR.

If at some point in the future this breaks, Opera may have changed the CSS classes on the red console warning elements. In such a case someone should edit this answer, only the two lines that contain "devtools_custom_css" will need to be changed. Everything else in this answer will still work.

EDIT: Removed for brevity, go look through edit history to see commented files if you really want to understand the strange reasons behind each partial solution involved to create extension.

Clemen answered 3/6, 2022 at 6:20 Comment(4)
Thanks a lot for sharing. I wasn't sure we have access to the warning via extensions, I'm glad we do. The extension is working as is, without additional measures.Taunt
Sorry the answer is so wordy... many coders have lots more experience writing extensions than me, but some others might be good at javascript but have no experience writing an extension or adding their own extension so I have provided as much instructions as possible. The extension might work by itself but for anyone out there, do make sure you to change the setting "Allow extensions to load custom stylesheets" to enabled as that will give you two different methods of attack in case one fails.Clemen
I guess TL;DR section is needed. Something like: - Open this post in another browser to keep it at hand. - Add a__instructions__.txt, devtools_page.html, devtools_page_helper.js, inject_into_devtools.js, manifest.json files with respective content to kill_opera_console_warning folder in a location where it will stay permanently. - Open Extensions page, enable "developer mode", select the folder in "Load unpacked". - Enable "Allow in incognito" and "Allow access to search page" in installed extension. - Enable "Allow extensions to load custom stylesheets" in devtools>settings>experimentsTaunt
I can confirm that currently it works without "Allow extensions to load custom stylesheets" option either. No browser reload is needed, only devtools need to be reopenedTaunt
D
45

Based on answer by @SesameTastelikecheese. This guide is much simpler.
Fixes bug: Extension would only work if console panel was opened first. Always works now.


CREATE AN EXTENSION TO KILL OPERA CONSOLE WARNING

This will allow Opera to continue to be updated (good for security) and allow you to use the latest programming language features released in the coming months.

Bookmark this question for future updates.


Create a folder anywhere on your hard drive: kill_opera_console_warning

Create the following files directly inside the folder.

manifest.json

{
  "manifest_version"    :  3

, "name"                :  "AAA: Kill Opera Console Warning"
, "version"             :  "1.1"

, "devtools_page"       :  "devtools_page.html"

, "content_scripts"     :
    [
        {
          "js"          :  [ "inject_into_devtools.js" ]
        , "matches"     :  [ "<all_urls>" ]
        , "run_at"      :   "document_start"
        }
    ]

// Same key as kgejglhpjiefppelpmljglcjbhoiplfn (ChromeVox)
// see : https://mcmap.net/q/151677/-how-to-inject-javascript-into-chrome-devtools-itself/17044405#17044405
, "key"                 :   "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEGBi/oD7Yl/Y16w3+gee/95/EUpRZ2U6c+8orV5ei+3CRsBsoXI/DPGBauZ3rWQ47aQnfoG00sXigFdJA2NhNK9OgmRA2evnsRRbjYm2BG1twpaLsgQPPus3PyczbDCvhFu8k24wzFyEtxLrfxAGBseBPb9QrCz7B4k2QgxD/CwIDAQAB"
}

devtools_page.html

<html>
<head></head>
<body><script src="devtools_page_helper.js"></script></body>
</html>

devtools_page_helper.js

function apply_style_sheet_for_current_panel_only( )
    {
    const devtools_custom_css = `.console-view > div[class^="console-warning-" i] { display : none !important ; }` ;

    chrome.devtools.panels.applyStyleSheet( devtools_custom_css ) ;
    }

// run for whatever panel opens by default
apply_style_sheet_for_current_panel_only( ) ;

// fallback if Console panel was not opened by default (most likely due to Elements panel opening first)
chrome.devtools.panels.elements.onSelectionChanged.addListener( apply_style_sheet_for_current_panel_only ) ;

inject_into_devtools.js

// necessary for DevTools in private windows
if  (  /^(?:chrome-|opera-)?devtools:$/gi.test( window.location.protocol ) === true  )
    {
    const devtools_custom_css = `.console-view > div[class^="console-warning-" i] { display : none !important ; }` ;

    const add_css_rules = ( css_rules ) => { ( document.head || document.documentElement ).appendChild( document.createElement("style") ).innerHTML = css_rules ; } ;

    // applies to all panels
    add_css_rules( devtools_custom_css ) ;
    }

You should now have the following file structure:

+ kill_opera_console_warning
|-- manifest.json
|-- devtools_page.html
|-- devtools_page_helper.js
|-- inject_into_devtools.js

ADD EXTENSION TO OPERA

  1. Go to extensions page: Ctrl+Shift+E

    • Enable "Developer mode" (top right)
  2. Install the extension:

    • Click Load unpacked button (top left)

    • Find your "kill_opera_console_warning" folder

    • Go inside the folder, click Select Folder

    • Extension you created should load.

  3. Update extension settings:

    • Find extension: "AAA: Kill Opera Console Warning"

    • Tick the "Allow in Incognito" checkbox

    • Tick the "Allow access to search page results" checkbox


NOW CHANGE ONE SETTING IN DEVTOOLS, RESTART OPERA AND TEST EXTENSION

Extension will be working now but to cover an edge case, you need to update a setting.

  1. Close all instances of DevTools.

  2. Open a new normal window (not an incognito window)

    • Go to "about:blank", open DevTools Ctrl+Shift+I
  3. Open the DevTools settings F1

    • There should be lots of settings with checkboxes
    • Go to "Experiments" tab (top left)
  4. Set Allow extensions to load custom stylesheets to enabled.

    • Probably the first checkbox at the start of the list.
    • Otherwise use filter to search for "stylesheets".
  5. Close everything and restart:

    • Close DevTools settings, close DevTools.
    • Exit Opera, wait 5 seconds and restart Opera.
    • Repeat steps 2-3 to check setting is still enabled.
  6. Test extension is working:

    • On a random webpage, right click "Inspect Element"
    • Switch to console panel to test extension works.
  7. Problem solved for the next few months.


Come back to this question if the extension stops working.

Opera may have updated the classes on the warning messages. An editor will hopefully update the extension in this answer. Should that happen, completely remove the extension. Then follow the instructions again.

Dogmatize answered 6/6, 2022 at 20:44 Comment(5)
Worked right away. I just restarted opera without changing a setting. Thanks!Whether
Updoot. Worked perfectly. Now I'm inspired to write more browser extensions.Loxodrome
Thanks! saved it to gh: github.com/newvladimirov/opera-red-warningHennery
As of Opera Version 94.0.4606.38 (Chromium version 108.0.5359.125), I needed to remove the last " i" in devtools_custom_css to be just = '.console-view > div[class^="console-warning-"]' in both files devtools_page_helper.js and inject_into_devtools.jsSoulful
Worked just fine - easy to do. And piqued my interest in writing browser extensions! Thanks on a couple of counts!Employee
C
21

Do the following steps, they are very easy and you can remove the red console warning.

This answer will allow Opera to continue to be updated (good for security).

Bookmark this question since you may have to restart your browser multiple times.

Also, open this question in another browser eg Firefox, Edge or Chrome.

https://mcmap.net/q/338786/-red-warning-message-in-opera-console/72485455

Create a folder called: kill_opera_console_warning

  • Anywhere is ok (same drive where Opera is installed with admin permissions is best)

Create the following files directly inside the folder.

manifest.json

{
  "manifest_version"    :  3

, "name"                :  "AAA: Kill Opera Console Warning"
, "description"         :  "..."
, "version"             :  "1.0"

, "devtools_page"       :  "devtools_page.html"

// no permissions required
, "permissions"         :  [ ]

, "content_scripts"     :
    [
        {
          "js"          :  [ "inject_into_devtools.js" ]
        , "matches"     :  [ "<all_urls>" ]
        }
    ]

// Same key as kgejglhpjiefppelpmljglcjbhoiplfn (ChromeVox)
// see : https://mcmap.net/q/151677/-how-to-inject-javascript-into-chrome-devtools-itself/17044405#17044405
, "key"                 :   "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEGBi/oD7Yl/Y16w3+gee/95/EUpRZ2U6c+8orV5ei+3CRsBsoXI/DPGBauZ3rWQ47aQnfoG00sXigFdJA2NhNK9OgmRA2evnsRRbjYm2BG1twpaLsgQPPus3PyczbDCvhFu8k24wzFyEtxLrfxAGBseBPb9QrCz7B4k2QgxD/CwIDAQAB"
}

devtools_page.html

<html>
<head></head>
<body><script src="devtools_page_helper.js"></script></body>
</html>

devtools_page_helper.js

const devtools_custom_css_G = `.console-view > div[class^="console-warning-" i] { display : none ; }` ;

chrome.devtools.panels.applyStyleSheet( devtools_custom_css_G ) ;

inject_into_devtools.js

if  (   /^(?:chrome-|opera-)?devtools:$/gi.test( window.location.protocol ) === true   )
    {
    var red_console_warning__kill_GO = function red_console_warning__kill_TO( run_count_F = 0 )
        {
        if  (   run_count_F > 20   )   {   return ;   }
        
        var devtools_custom_css_selector_T = ".console-view > div[class^='console-warning-' i]" ;
            
        var garbage_TA = document.querySelectorAll( devtools_custom_css_selector_T ) ;
        
        for (   let one_piece_of_garbage_TH  of  garbage_TA   )
            {
            one_piece_of_garbage_TH.style.setProperty( "display" , "none" , "important" ) ;
            }
            
        if  (   garbage_TA.length > 0   )   {   return ;   }
            
        setTimeout( red_console_warning__kill_TO.bind( null , run_count_F+1 ) , 500 ) ;
        } ;

    red_console_warning__kill_GO( 0 ) ;
    }

You should now have the following file structure:

- kill_opera_console_warning
--- manifest.json
--- devtools_page.html
--- devtools_page_helper.js
--- inject_into_devtools.js

NOW ADD THE EXTENSION YOU JUST CREATED TO OPERA

  1. Open a new tab and go to: "opera://extensions"

  2. "Developer mode" should be enabled (top_right_corner)

  3. Click on the "Load unpacked" button (near top_left_corner)

  4. A file picker should appear, go find the "kill_opera_console_warning" folder

  5. Go inside the folder, click "Select Folder"

  6. Your extension should load.

  7. Go through your extensions and find "AAA: Kill Opera Console Warning"

  8. Tick the "Allow in Incognito" checkbox

  9. Tick the "Allow access to search page results" checkbox


LASTLY WE CHANGE ONE SETTING IN DEVTOOLS, RESTART OPERA AND THEN TEST IT

At this point if you refresh the DevTools it will appear the extension you created is working and the problem is solved. This extension uses two methods, one is a hack and the other is more robust. The hack will stop working one day. The robust method requires a setting to be changed.

  1. Close all instances of DevTools that you have open.

  2. Open a new normal window (not an incognito window).

  3. Go to "about:blank"

  4. Open DevTools (Ctrl+Shift+I)

  5. Press F1 to open the PROPER settings

  6. There should now be an enormous amount of settings with checkboxes

  7. Click on the "Experiments" tab (top_left_corner with the word "Settings" nearby)

  8. Tick the checkbox for "Allow extensions to load custom stylesheets" so that it is ENABLED. Probably the first checkbox at the very start of the list. (If it is not the first checkbox then use the search box with the word "Filter" next to it. Type in "stylesheets".)

  9. Close the settings and close the DevTools. Exit Opera so that all windows are closed.

  10. Wait 5 seconds and restart Opera.

  11. Open a new window

  12. Go to "about:blank"

  13. Open DevTools (Ctrl+Shift+I)

  14. Go to Console tab.

  15. You may see the red warning briefly for half a second but it should disappear. If you do not see it, congratulations!

  16. If you still see the warning OR it comes back then "Allow extensions to load custom stylesheets" has probably DISABLED itself.

  17. Go back to step 6 of these instructions and make sure the checkbox is enabled. If it has DISABLED itself, then you will need to ENABLE it again and go through all the instructions from step 6-19 again. It may require a few tries (browser restarts) to get it to stick.


STILL NOT WORKING

If the checkbox stays ENABLED after browser resets but you are still seeing the red warning then maybe start over (remove extension, delete files) then repeat all steps from the beginning in case you made an error.

If you are sure you have followed the instructions exactly then you may have to play around with them a little but they definitely do work so long as the extension is installed properly and you manage to get ""Allow extensions to load custom stylesheets" to stay ENABLED.


ONLY READ PAST HERE IF YOU ARE A STACKOVERFLOW EDITOR.

If at some point in the future this breaks, Opera may have changed the CSS classes on the red console warning elements. In such a case someone should edit this answer, only the two lines that contain "devtools_custom_css" will need to be changed. Everything else in this answer will still work.

EDIT: Removed for brevity, go look through edit history to see commented files if you really want to understand the strange reasons behind each partial solution involved to create extension.

Clemen answered 3/6, 2022 at 6:20 Comment(4)
Thanks a lot for sharing. I wasn't sure we have access to the warning via extensions, I'm glad we do. The extension is working as is, without additional measures.Taunt
Sorry the answer is so wordy... many coders have lots more experience writing extensions than me, but some others might be good at javascript but have no experience writing an extension or adding their own extension so I have provided as much instructions as possible. The extension might work by itself but for anyone out there, do make sure you to change the setting "Allow extensions to load custom stylesheets" to enabled as that will give you two different methods of attack in case one fails.Clemen
I guess TL;DR section is needed. Something like: - Open this post in another browser to keep it at hand. - Add a__instructions__.txt, devtools_page.html, devtools_page_helper.js, inject_into_devtools.js, manifest.json files with respective content to kill_opera_console_warning folder in a location where it will stay permanently. - Open Extensions page, enable "developer mode", select the folder in "Load unpacked". - Enable "Allow in incognito" and "Allow access to search page" in installed extension. - Enable "Allow extensions to load custom stylesheets" in devtools>settings>experimentsTaunt
I can confirm that currently it works without "Allow extensions to load custom stylesheets" option either. No browser reload is needed, only devtools need to be reopenedTaunt
S
2

Downgrading your browser is the only way right now. (Edit: It's not the only way, read the answer by @Sesame Tastelikecheese) You could wait for an update but who knows if they'll even fix this. So if you're okay with disabling auto-updates, here's how you downgrade your browser:

  1. Download Opera 86.0.4363.59 from here (windows installer) or choose another version here (any version before 87.x.xxxx.xx)
  2. Go to your Opera installation directory and delete the 87.x.xxxx.xx folder.
  3. Run the installer, set Install Path to your current Opera directory. Click "Accept and Upgrade".
  4. Again, from your Opera installation directory, open the 86.0.4363.59 folder (or whatever version you've just installed). Rename the opera_autoupdate executable to anything you want.
  5. Open Task Scheduler (Control Panel -> System and Security -> Administrative Tools -> Schedule Tasks/Task Scheduler). Disable Opera scheduled Autoupdate and Opera scheduled assistant Autoupdate tasks.

Warning: Opera may autoupdate after step 2 or step 3 if you don't do the next steps fast enough, so it may take a couple tries. Or you could disable your internet connection right after you install the older version.

Stewart answered 2/6, 2022 at 12:28 Comment(2)
"Opera may autoupdate after step 2 or step 3 if you don't do the next steps fast enough" Or just disable your Internet connectionSoprano
@MarinaDunst lol I've already suggested that in the next sentenceStewart

© 2022 - 2024 — McMap. All rights reserved.