Skip to content

Instantly share code, notes, and snippets.

@mattcuk
Created March 23, 2018 13:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mattcuk/91953077ffc0ce4de4a26899ace9b7b3 to your computer and use it in GitHub Desktop.
FeatherTest - Output Page Variables (and JSON-LD)
'feathertest'
console.log('%cSUDO - HOMEPAGE', 'color:orange');
location.href = '/site_root/'
60000
console.log('%cSUDO - '+location.href, 'color:orange');
// Output JSON-LD on page
$('script[type="application/ld+json"]').each(function(index,json){ console.log('%cSUDO - '+JSON.stringify(JSON.parse(json.innerHTML),null,2), 'color:orange') });
// Output the contents of some JavaScript variables
window.postMessage({ "action": "variable", "value": "myVar.hierarchy"}, window.origin);
window.postMessage({ "action": "variable", "value": "myVar.channel"}, window.origin);
window.postMessage({ "action": "variable", "value": "currentContainer.name"}, window.origin);
console.log('%cSUDO - ', 'color:orange');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment