Skip to content

Instantly share code, notes, and snippets.

@xagronaut
Created December 13, 2019 18:03
Show Gist options
  • Save xagronaut/0ea06802489a370ff6a7757c62627a69 to your computer and use it in GitHub Desktop.
Save xagronaut/0ea06802489a370ff6a7757c62627a69 to your computer and use it in GitHub Desktop.
Use mrcoles.com/bookmarklet tool to convert this to a bookmarklet! It will check the page for clues about what tool was used to generate it (e.g., WordPress, Wix).
var attributeWanted = {
"meta": "content",
"link": "href",
"script": "src",
"img": "src",
"iframe": "src"
};
var title = (document.querySelector('title') || {
innerHTML: ''
}).innerHTML + '\n';
var clues = title + window.location.href + ':\n' + (
["meta[name='generator']", "link[href*='theme']", "script[href*='theme']", "link[href*='wp-'], [src*='wp-']", "link[href*='wix'], [src*='wix']"].map(function(clue) {
var qResult = document.querySelector(clue),
tagName = (qResult && qResult.tagName.toLowerCase()) || null,
attrName = (tagName && attributeWanted[tagName]) || null;
var result = (qResult && (clue + '=>' + tagName + '/@' + attrName + '= ' + qResult.getAttribute(attrName)));
return result;
})
.filter(function(x) {
return x;
})
.join('\n') || 'Unknown') + '\n';
prompt('Copy this', clues.replace(/^\s*/, ''));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment