Getting XPath in websites that have Right-Click Disabled

noellarkin

Senior Member
Joined
Mar 14, 2021
Messages
1,006
Reaction score
1,492
I use selectorshub to get XPath/JSPath for websites. Recently, one of the sites I'm working with has disabled all right clicks. I'm guessing its some JS script that's doing it. However, the site itself is heavy on JS so disabling JS just ends up breaking the site. How do I find the JS that's responsible for disabling right click (I can use uBlock to selectively disable it)?
 
Easiest option is to use this plugin to enable right click again..

Code:
https://chrome.google.com/webstore/detail/enable-right-click/hhojmcideegachlhfgfdhailpfhgknjm?hl=en

This one works fine, tested.

However though, it won't work with more advanced ones which set a debugger break point if you inspect element. That's another story lol.

P.s. you don't need another service to get the xpath, just right click the element in the inspect element dom -> copy -> copy xpath/copy full xpath will do the job just fine.
 
If you’re on Chrome just push the devtools shortcut. I want to say F9 or something. It’ll how the elements as you hover over it. No need for right click or installing a plugin.
 
If you’re on Chrome just push the devtools shortcut. I want to say F9 or something. It’ll how the elements as you hover over it. No need for right click or installing a plugin.
That will be a F12.
 
P.s. you don't need another service to get the xpath, just right click the element in the inspect element dom -> copy -> copy xpath/copy full xpath will do the job just fine.
yep yep, true, this would work as well, I just like to save myself the extra right clicks :) also, am a beginner when it comes to coding in general, so the less code I have to look at, the easier it makes things for me :)
 
"curl" the whole website from the terminal into file and read the source code and find it that way. Or use Postman to do that.
 
Back
Top