mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
fix FF add-on validator warning
This commit is contained in:
parent
8ea4116e20
commit
d827accdf0
1 changed files with 16 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue