mirror of
https://github.com/zen-browser/desktop.git
synced 2026-02-22 03:16:40 +00:00
feat: Removed legacy stylesheets config and implement c++ mods backen… (#9131)
This commit is contained in:
20
src/dom/base/Document-cpp.patch
Normal file
20
src/dom/base/Document-cpp.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp
|
||||
index a16bef739fcde0f14ba7e53e0acfa3aa2ee1dd3a..78b9d112a56b3d909e31eb4351ee9f3b06c4ef92 100644
|
||||
--- a/dom/base/Document.cpp
|
||||
+++ b/dom/base/Document.cpp
|
||||
@@ -3332,6 +3332,15 @@ void Document::FillStyleSetUserAndUASheets() {
|
||||
|
||||
ServoStyleSet& styleSet = EnsureStyleSet();
|
||||
for (StyleSheet* sheet : *sheetService->UserStyleSheets()) {
|
||||
+ // If the url starts with "chrome://" and ends with 'zen-themes.css', then
|
||||
+ // skip it if the document is in a chrome docshell.
|
||||
+ // This is to avoid loading the user chrome stylesheet in the content
|
||||
+ // process, which is not allowed.
|
||||
+ auto spec = sheet->GetSheetURI()->GetSpecOrDefault();
|
||||
+ if (!IsInChromeDocShell() && StringBeginsWith(spec, "file://"_ns) &&
|
||||
+ StringEndsWith(spec, "zen-themes.css"_ns)) {
|
||||
+ continue;
|
||||
+ }
|
||||
styleSet.AppendStyleSheet(*sheet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user