1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

fix FF add-on validator warning

This commit is contained in:
gorhill 2016-10-25 10:20:29 -04:00
parent 8ea4116e20
commit d827accdf0

View File

@ -61,7 +61,22 @@ var safeTextToTagNode = function(text) {
node.setAttribute('type', matches[2]);
return node;
}
return document.createElement(text);
// Firefox extension validator warns if using a variable as argument for
// document.createElement().
switch ( text ) {
case 'b':
return document.createElement('b');
case 'code':
return document.createElement('code');
case 'em':
return document.createElement('em');
case 'i':
return document.createElement('i');
case 'span':
return document.createElement('span');
default:
break;
}
};
var safeTextToTextNode = function(text) {