I have a JavaScript button to remove the annoying 'autocomplete="off"' (because that's my decision, not yours). How can I do the same for websites that turn off copy/paste? (I can easily disable JavaScript, copy/paste and enable it again, but that's more troublesome than just clicking a button). I use a variety of different browsers so I'd prefer a JavaScript solution but I'm happy to be pointed to a browser-specific version if one exists.
Asked
Active
Viewed 2,092 times
4
-
1Are you asking about client-side features? If so, I'm not sure SO is the correct place for this question. – turbonerd Aug 09 '12 at 11:50
-
Yes, although it's still a coding question. Happy to be directed to a more suitable Stack if you think there's a better place though. – Nathan Aug 09 '12 at 11:52
-
If it's a coding question I'm afraid I don't understand what you're asking! If you're trying to work out how to disable website's specific JavaScript features on your browser, you might want to check out http://superuser.com/ – turbonerd Aug 09 '12 at 11:54
-
I have the following code as a bookmarklet in my browser bar. It removes autocomplete=off. I want the same thing for copy/paste blocking (eg. opposite of SO question 1226574 `javascript:(function(){var%20ac,c,f,fa,fe,fea,x,y,z;ac="autocomplete";c=0;f=document.forms;for(x=0;x
– Nathan Aug 09 '12 at 11:58 -
SO question 1226574 [http://stackoverflow.com/questions/1226574/disable-copy-paste-into-html-form-using-javascript] suggests using oninput or onpaste. So a quick job at this would be the equivalent JS to the above to remove any onpaste events in the page (I imagine removing oninput may be more problematic) – Nathan Aug 09 '12 at 12:03
1 Answers
1
I'm afraid it is not something you can easily have done, as it would require heuristics to determine if attached event handlers are filtering input or doing something else.
Easiest way would be to turn off javascript, and if website is made good enough it would degrade gracefully and remain functioning. But you'll be able to use copy and paste

vittore
- 17,449
- 6
- 44
- 82
-
It doesn't have to be perfect; I'm happy with a starting version as per my above comment in response to @dunc - just remove any 'onpaste' events, and perhaps oninput events too. I realise there may be more complex ways people are doing this, but presumably most people are doing it in, at most, 2-3 common ways? – Nathan Aug 09 '12 at 12:05
-
well, this way you can check for handlers for events you mentioned in pretty much the same manner as you doing it now. However some libraries like jquery implement event delegation, or live events if you will, so you need to check not only form controls but all parent elements up to the body. – vittore Aug 09 '12 at 13:12