Skip to content

Instantly share code, notes, and snippets.

@st98
Created June 6, 2015 15:03
Show Gist options
  • Save st98/d16117232a380661c5fc to your computer and use it in GitHub Desktop.
Save st98/d16117232a380661c5fc to your computer and use it in GitHub Desktop.
DOMCharacterDataModified
javascript:
var a = [
prompt('title'),
"document.getElementById('h').addEventListener('DOMCharacterDataModified', function (s) { document.title = s.newValue; })"
];
var t = 'data:text/html;charset=utf-8,<!doctype html><meta charset="utf-8"><title>$1</title><h1 id="h" contenteditable>$1</h1><script>$2</script>';
location.href = t.replace(/[$]\d+/g, function (s) { return a[parseInt(s.slice(1), 10) - 1]; });
javascript:var a=[prompt('title'), "document.getElementById('h').addEventListener('DOMCharacterDataModified', function (s) { document.title = s.newValue; })"];location.href='data:text/html;charset=utf-8,<!doctype html><meta charset="utf-8"><title>$1</title><h1 id="h" contenteditable>$1</h1><script>$2</script>'.replace(/[$]\d+/g, function (s) { return a[parseInt(s.slice(1), 10) - 1]; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment