Skip to content

Commit

Permalink
Keep existing style sheets in document when adding own
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Feb 24, 2021
1 parent d852513 commit 28ff1ed
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const char kHideSelectorsInjectScript[] =
if (!document.adoptedStyleSheets.includes(
window.content_cosmetic.cosmeticStyleSheet)) {
document.adoptedStyleSheets =
[window.content_cosmetic.cosmeticStyleSheet];
[...document.adoptedStyleSheets, window.content_cosmetic.cosmeticStyleSheet];
};
})();)";

Expand All @@ -92,7 +92,7 @@ const char kForceHideSelectorsInjectScript[] =
if (!document.adoptedStyleSheets.includes(
window.content_cosmetic.cosmeticStyleSheet)) {
document.adoptedStyleSheets =
[window.content_cosmetic.cosmeticStyleSheet];
[...document.adoptedStyleSheets, window.content_cosmetic.cosmeticStyleSheet];
};
})();)";

Expand Down Expand Up @@ -123,8 +123,8 @@ const char kStyleSelectorsInjectScript[] =
};
if (!document.adoptedStyleSheets.includes(
window.content_cosmetic.cosmeticStyleSheet)){
document.adoptedStyleSheets =
[window.content_cosmetic.cosmeticStyleSheet];
document.adoptedStyleSheets =
[...document.adoptedStyleSheets, window.content_cosmetic.cosmeticStyleSheet];
};
})();)";

Expand Down

0 comments on commit 28ff1ed

Please sign in to comment.