Skip to content

Instantly share code, notes, and snippets.

@shulgatyy
shulgatyy / bm.title-attr.js
Last active March 14, 2018 17:18
mobile bookmarklet for view title attr
(() => {
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));
})();