1

I have next question: can I in any way attach my script file to a web site opened in my web browser? This script should be executed only in my machine and should emulate events like onclick ,onmouseover, etc. I found that I can emulate that events in this way:

var element = document.getElementById('element_id');
var o = document.createEvent('MouseEvents');
o.initMouseEvent( 'click', true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null );
element.dispatchEvent(o);

But I don't understand how I can implement this code in concrete my situation? Where should I locate this code? How do I attach it the site? How can I generate browser's events for this site? And can I do it?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
abilash
  • 897
  • 3
  • 12
  • 32

1 Answers1

1

You can bookmark the script in your browser and then click the bookmark to run it on the page you are currently on.

Load external JS from bookmarklet?

Community
  • 1
  • 1
jholloman
  • 1,959
  • 14
  • 16