summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2017-08-06 22:54:07 +0530
committerArun Isaac2017-08-06 22:54:07 +0530
commit689eb3352fd4630b350f7482597775e8c8a65d1b (patch)
tree194c6aac73394226bb0bbd50b16626a2782ad949
parent768c7a78f5b6208caad13264110ce5a1a45c25df (diff)
downloadyoutube-noscript-shim-689eb3352fd4630b350f7482597775e8c8a65d1b.tar.gz
youtube-noscript-shim-689eb3352fd4630b350f7482597775e8c8a65d1b.tar.lz
youtube-noscript-shim-689eb3352fd4630b350f7482597775e8c8a65d1b.zip
Do not assign to innerHTML.
* viewtube.js (createElement): Do not assign to innerHTML. Mozilla considers this unsafe.
-rw-r--r--viewtube.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/viewtube.js b/viewtube.js
index dfad54f..8ed1076 100644
--- a/viewtube.js
+++ b/viewtube.js
@@ -49,10 +49,8 @@
function createElement (type, attributes, parent) {
var element = document.createElement(type);
- for (var key in attributes) {
- if (key == 'innerHTML') element.innerHTML = attributes[key];
- else element.setAttribute(key, attributes[key]);
- }
+ for (var key in attributes)
+ element.setAttribute(key, attributes[key]);
if (parent) parent.appendChild(element);
return element;
}