MCPcopy
hub / github.com/hoothin/UserScripts / click

Function click

Picviewer CE+/Picviewer CE+.user.js:151–159  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

149
150
151 function click(node) {
152 try {
153 node.dispatchEvent(new MouseEvent('click'));
154 } catch (e) {
155 var evt = document.createEvent('MouseEvents');
156 evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
157 node.dispatchEvent(evt);
158 }
159 } // Detect WebView inside a native macOS app by ruling out all browsers
160 // We just need to check for 'Safari' because all other browsers (besides Firefox) include that too
161 // https://www.whatismybrowser.com/guides/the-latest-user-agent/macos
162

Callers 1

Calls 1

checkLimitFunction · 0.70

Tested by

no test coverage detected