Last active
March 14, 2018 17:18
-
-
Save shulgatyy/47fc4560ae21bcfae47d4d9dff3c13ad to your computer and use it in GitHub Desktop.
mobile bookmarklet for view title attr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const onclick = e => { | |
if (e.target.tagName == "A") e.preventDefault(); | |
const title = e.target.getAttribute("title"); | |
if (title) alert(title); | |
}; | |
document.onclick = onclick; | |
const docs = document.querySelectorAll("iframe"); | |
[].forEach.call(docs, doc => (doc.contentDocument.onclick = onclick)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment