1
0
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:
Deathamns 2015-02-11 17:49:50 +01:00
parent af05ceffb8
commit 2642d5aa92

View File

@ -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);