mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
fix #3090
This commit is contained in:
parent
a19efa4ebe
commit
a6b01cb0e5
1 changed files with 15 additions and 13 deletions
|
@ -1416,7 +1416,7 @@ var stopPicker = function() {
|
|||
svgRoot.removeEventListener('touchend', onSvgTouchStartStop);
|
||||
pickerStyle.parentNode.removeChild(pickerStyle);
|
||||
pickerRoot.parentNode.removeChild(pickerRoot);
|
||||
pickerRoot.onload = null;
|
||||
pickerRoot.removeEventListener('load', stopPicker);
|
||||
pickerRoot =
|
||||
pickerBody =
|
||||
dialog =
|
||||
|
@ -1429,7 +1429,7 @@ var stopPicker = function() {
|
|||
/******************************************************************************/
|
||||
|
||||
var startPicker = function(details) {
|
||||
pickerRoot.onload = stopPicker;
|
||||
pickerRoot.addEventListener('load', stopPicker);
|
||||
|
||||
var frameDoc = pickerRoot.contentDocument;
|
||||
var parsedDom = (new DOMParser()).parseFromString(
|
||||
|
@ -1534,6 +1534,18 @@ var startPicker = function(details) {
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
var bootstrapPicker = function() {
|
||||
pickerRoot.removeEventListener('load', bootstrapPicker);
|
||||
vAPI.shutdown.add(stopPicker);
|
||||
vAPI.messaging.send(
|
||||
'elementPicker',
|
||||
{ what: 'elementPickerArguments' },
|
||||
startPicker
|
||||
);
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
pickerRoot = document.createElement('iframe');
|
||||
pickerRoot.id = vAPI.sessionId;
|
||||
pickerRoot.style.cssText = [
|
||||
|
@ -1581,19 +1593,9 @@ if ( vAPI.userCSS ) {
|
|||
vAPI.userCSS.add(pickerStyle.textContent);
|
||||
}
|
||||
|
||||
pickerRoot.onload = function() {
|
||||
vAPI.shutdown.add(stopPicker);
|
||||
vAPI.messaging.send(
|
||||
'elementPicker',
|
||||
{ what: 'elementPickerArguments' },
|
||||
startPicker
|
||||
);
|
||||
};
|
||||
|
||||
pickerRoot.addEventListener('load', bootstrapPicker);
|
||||
document.documentElement.appendChild(pickerRoot);
|
||||
|
||||
// https://www.youtube.com/watch?v=sociXdKnyr8
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue