How to re-enable right click so that I can inspect HTML elements in Chrome?

前端 未结 18 1124
囚心锁ツ
囚心锁ツ 2021-01-29 20:55

I am looking at a web page which has overwritten the right-click button so to display its own popup HTML element.

This prevents me from using Chrome Developer Tools to

相关标签:
18条回答
  • 2021-01-29 21:06

    The easiest way I found is to open the webpage in Read mode (browser that supports read mode like Safari, Firefox etc) and then copy as usual

    0 讨论(0)
  • 2021-01-29 21:07

    Easiest thing to do is open the dev tools by pressing Cmd + Opt + I (Mac) or F12 (PC). You can then use the search (magnifying glass, top left on the dev tools toolbar) to select the element.

    0 讨论(0)
  • Hi i have a shorter version. this does same as a best answer. (it works on chrome 74.03)

    document.querySelectorAll('*').forEach(e => e.oncontextmenu = null)
    
    0 讨论(0)
  • 2021-01-29 21:10

    Tested in Chrome 60.0.3112.78.

    Some of the above methods work, but the easiest in my opinion is:

    1. Open dev tools (Shift+Control+i).

    2. Select the "Elements" tab, and then the "Event Listeners" tab.

    3. Hover over the elements/listener. A "Remove" button will show up.

    4. Click "Remove".

    E.g. see photo.

    0 讨论(0)
  • 2021-01-29 21:10

    You could use javascript:void(document.oncontextmenu=null); open Browser console and run the code above. It will turn off blockin' of mouse right button

    0 讨论(0)
  • 2021-01-29 21:12

    you can use following code for re-enable mouse right click.

    document.oncontextmenu = function(){}
    

    and you can use shortcut key (Ctrl+Shift+i) to open inspect elements in chrome in windows OS.

    0 讨论(0)
提交回复
热议问题