Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by D Ft
at 2024-09-11 20:58:35
Point:500 Replies:5 POST_ID:829270USER_ID:12422
Topic:
javascript
it seems Goolge Ads iframe block onclick function except onmouseover..etc,
Any way , I can detect users click on mysite Google Ads that want to prevent
some fault click or invalid traffic on mysite..
Any comment
Expert: Wilson Edwards replied at 2024-09-12 17:36:25
Expert: Wilson Edwards replied at 2024-09-12 17:11:38
Author: D Ft replied at 2024-09-11 21:04:43
Author: D Ft replied at 2024-09-11 21:03:48
Accepted Solution
Author: D Ft replied at 2024-09-11 21:02:29
500 points Excellent
I get this link, it work for cross-domin iframe, but not check whether it work on GOogle's iframe.
var clickIframe = window.setInterval(checkFocus, 100);
var i = 0;
function checkFocus() {
if(document.activeElement == document.getElementById("ifr")) {
console.log("clicked "+(i++));
window.focus();
}
}
<!DOCTYPE html>
<h2>Onclick event on iframe</h2>
<iframe src="https://www.brokenbrowser.com/" id="ifr"></iframe>
u needdocument.activeElement
Reference link:
https://stackoverflow.com/questions/29337304/how-to-detect-a-click-inside-of-an-iframe-cross-domain-aka-prevent-click-frau?newreg=9bc724f14db845278084d710f8e1ffd9
https://stackoverflow.com/questions/5850133/detect-google-ads-click