mirror of https://github.com/gorhill/uBlock.git
fix #2810
This commit is contained in:
parent
48ee02980b
commit
0d892a8856
|
@ -167,6 +167,10 @@ var cosmeticFiltersActivated = function() {
|
||||||
// Probably no longer need to watch for style tags removal/tampering with fix
|
// Probably no longer need to watch for style tags removal/tampering with fix
|
||||||
// to https://github.com/gorhill/uBlock/issues/963
|
// to https://github.com/gorhill/uBlock/issues/963
|
||||||
|
|
||||||
|
// https://github.com/gorhill/uBlock/issues/2810
|
||||||
|
// With Firefox Nightly, it may happens style tags are injected before the
|
||||||
|
// head element is present.
|
||||||
|
|
||||||
var platformUserCSS = (function() {
|
var platformUserCSS = (function() {
|
||||||
if ( vAPI.userCSS instanceof Object ) {
|
if ( vAPI.userCSS instanceof Object ) {
|
||||||
return vAPI.userCSS;
|
return vAPI.userCSS;
|
||||||
|
@ -179,8 +183,9 @@ var platformUserCSS = (function() {
|
||||||
var style = document.createElement('style');
|
var style = document.createElement('style');
|
||||||
style.setAttribute('type', 'text/css');
|
style.setAttribute('type', 'text/css');
|
||||||
style.textContent = css;
|
style.textContent = css;
|
||||||
if ( document.head ) {
|
var parent = document.head || document.documentElement;
|
||||||
document.head.appendChild(style);
|
if ( parent !== null ) {
|
||||||
|
parent.appendChild(style);
|
||||||
}
|
}
|
||||||
this.styles.push(style);
|
this.styles.push(style);
|
||||||
if ( style.sheet ) {
|
if ( style.sheet ) {
|
||||||
|
|
Loading…
Reference in New Issue