Created
January 24, 2013 15:12
-
-
Save arantius/4622821 to your computer and use it in GitHub Desktop.
Test case for Greasemonkey issue #1571
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
// ==UserScript== | |
// @name dataset test | |
// @version 1 | |
// @include * | |
// ==/UserScript== | |
var el_work = document.createElement('div'); | |
el_work.id = 'el_work'; | |
el_work.setAttribute('data-test2', 'test'); | |
document.head.appendChild(el_work); | |
var el_fail = document.createElement('div'); | |
el_fail.id = 'el_fail'; | |
el_fail.dataset.test1 = 'test'; | |
document.head.appendChild(el_fail); | |
setTimeout(function() { | |
dump('el_work: ' + document.getElementById('el_work').dataset.test2 + '\n'); | |
dump('el_fail: ' + document.getElementById('el_fail').dataset.test1 + '\n'); | |
dump(document.head.innerHTML + '\n'); | |
}, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment