mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
replacing documentElement is enough
This commit is contained in:
parent
af05ceffb8
commit
2642d5aa92
@ -690,21 +690,17 @@ var stopPicker = function() {
|
||||
/******************************************************************************/
|
||||
|
||||
var startPicker = function(details) {
|
||||
pickerRoot.onload = stopPicker;
|
||||
|
||||
var frameDoc = pickerRoot.contentDocument;
|
||||
var parsedDom = (new DOMParser()).parseFromString(
|
||||
details.frameContent,
|
||||
'text/html'
|
||||
);
|
||||
|
||||
pickerRoot.onload = stopPicker;
|
||||
|
||||
frameDoc.documentElement.replaceChild(
|
||||
frameDoc.adoptNode(parsedDom.head),
|
||||
frameDoc.head
|
||||
);
|
||||
frameDoc.documentElement.replaceChild(
|
||||
frameDoc.adoptNode(parsedDom.body),
|
||||
frameDoc.body
|
||||
frameDoc.replaceChild(
|
||||
frameDoc.adoptNode(parsedDom.documentElement),
|
||||
frameDoc.documentElement
|
||||
);
|
||||
|
||||
frameDoc.body.setAttribute('lang', navigator.language);
|
||||
|
Loading…
Reference in New Issue
Block a user