WebKit Bugzilla
Attachment 360080 Details for
Bug 193813
: Web Inspector: provide a way to edit page settings on a remote target
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193813-20190124221513.patch (text/plain), 29.00 KB, created by
Devin Rousso
on 2019-01-24 22:15:14 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-24 22:15:14 PST
Size:
29.00 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index bdf15f7981394565e54f5cef9ceb8ee1c5d3ceff..1645ce7c5ffb564cabb4c3b4b1be4ce41fc3746a 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-24 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193813 >+ <rdar://problem/47359510> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/protocol/Page.json: >+ Add `overrideSetting` command with supporting `Setting` enum type. >+ > 2019-01-24 Guillaume Emont <guijemont@igalia.com> > > [JSC] Reenable baseline JIT on mips >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b7e8ffabd63906858d7d1bfe17d792080409225e..7db8323a1829892e19b89dc04273927dcf97e87b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+2019-01-24 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193813 >+ <rdar://problem/47359510> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * page/Settings.yaml: >+ * Scripts/GenerateSettings.rb: >+ * Scripts/SettingsTemplates/Settings.cpp.erb: >+ * Scripts/SettingsTemplates/Settings.h.erb: >+ Add support for an `inspectorOverride` boolean value for each setting that will take >+ precedence over the actual `Setting`'s value when set. >+ >+ * inspector/agents/InspectorPageAgent.h: >+ * inspector/agents/InspectorPageAgent.cpp: >+ (WebCore::InspectorPageAgent::disable): >+ (WebCore::InspectorPageAgent::overrideSetting): Added. >+ >+ * inspector/InspectorFrontendHost.idl: >+ * inspector/InspectorFrontendHost.h: >+ * inspector/InspectorFrontendHost.cpp: >+ (WebCore::InspectorFrontendHost::isRemote const): Added. >+ * inspector/InspectorFrontendClient.h: >+ (WebCore::InspectorFrontendClient::isRemote const): Added. >+ * inspector/InspectorFrontendClientLocal.h: >+ (WebCore::InspectorFrontendClientLocal::isRemote const): Added. >+ > 2019-01-24 Youenn Fablet <youenn@apple.com> > > Use MonotonicTime in WorkerRunLoop >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 44053a80022a1daf4c0f3351611e0f8fd99394b8..4d5e18e2a51218a1eb577748ca45cce9c86eccc2 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-24 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193813 >+ <rdar://problem/47359510> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add toolbar button that creates a `WI.ContextMenu` when clicked that contains checkbox items >+ for each overridable setting. >+ >+ * UserInterface/Base/Main.js: >+ (WI.loaded): >+ (WI.contentLoaded): >+ (WI.performOneTimeFrontendInitializationsUsingTarget): >+ (WI._handleOverridePageSettingsToolbarButtonClicked): Added. >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2019-01-23 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 034c6545c8969630194377b0f2d7e8ca56950d15..99178c26d7cbbba267631c6a5359bf53daded99b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-24 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193813 >+ <rdar://problem/47359510> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/WebInspectorUI.h: >+ (WebKit::WebInspectorUI::isRemote() const): Added. >+ * WebProcess/WebPage/RemoteWebInspectorUI.h: >+ (WebKit::RemoteWebInspectorUI::isRemote() const): Added. >+ > 2019-01-24 Antti Koivisto <antti@apple.com> > > [PSON] Flash on back navigation on Mac >diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json >index b94a5f9ffe3caf3440a49b11e601fc3d9b8f8eac..9eaed5114a075ece07c1b02bc130bc6880badead 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Page.json >+++ b/Source/JavaScriptCore/inspector/protocol/Page.json >@@ -3,6 +3,18 @@ > "description": "Actions and events related to the inspected page belong to the page domain.", > "availability": ["web"], > "types": [ >+ { >+ "id": "Setting", >+ "type": "string", >+ "description": "List of settings able to be overridden by WebInspector. Keep this in sync with FOR_EACH_INSPECTOR_OVERRIDE_SETTING.", >+ "enum": [ >+ "AuthorAndUserStylesEnabled", >+ "ImagesEnabled", >+ "NeedsSiteSpecificQuirks", >+ "ScriptEnabled", >+ "WebSecurityEnabled" >+ ] >+ }, > { > "id": "ResourceType", > "type": "string", >@@ -117,6 +129,14 @@ > { "name": "url", "type": "string", "description": "URL to navigate the page to." } > ] > }, >+ { >+ "name": "overrideSetting", >+ "description": "Allows the frontend to override the inspected page's settings.", >+ "parameters": [ >+ { "name": "setting", "$ref": "Setting" }, >+ { "name": "value", "type": "boolean", "optional": true, "description": "Value to override the setting with. If this value is not provided, the override is removed. Overrides are removed when WebInspector closes/disconnects." } >+ ] >+ }, > { > "name": "getCookies", > "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the <code>cookies</code> field.", >diff --git a/Source/WebCore/Scripts/GenerateSettings.rb b/Source/WebCore/Scripts/GenerateSettings.rb >index cf5f1af0f16c01d6f47c593f1fc37d0f80fd8137..8aca9456bfe74edc3f9b7d81ff7f01b686dc12e3 100755 >--- a/Source/WebCore/Scripts/GenerateSettings.rb >+++ b/Source/WebCore/Scripts/GenerateSettings.rb >@@ -68,6 +68,7 @@ class Setting > attr_accessor :conditional > attr_accessor :onChange > attr_accessor :getter >+ attr_accessor :inspectorOverride > > def initialize(name, opts) > @name = name >@@ -76,6 +77,7 @@ class Setting > @conditional = opts["conditional"] > @onChange = opts["onChange"] > @getter = opts["getter"] >+ @inspectorOverride = opts["inspectorOverride"] > end > > def valueType? >@@ -113,6 +115,10 @@ class Setting > @onChange != nil > end > >+ def hasComplexGetter? >+ hasInspectorOverride? >+ end >+ > def setterFunctionName > if @name.start_with?("css", "xss", "ftp", "dom", "dns") > "set" + @name[0..2].upcase + @name[3..@name.length] >@@ -124,6 +130,10 @@ class Setting > def getterFunctionName > @getter || @name > end >+ >+ def hasInspectorOverride? >+ @inspectorOverride == true >+ end > end > > class Conditional >@@ -131,6 +141,7 @@ class Conditional > attr_accessor :settings > attr_accessor :boolSettings > attr_accessor :nonBoolSettings >+ attr_accessor :settingsWithComplexGetters > attr_accessor :settingsWithComplexSetters > > def initialize(condition, settings) >@@ -139,6 +150,7 @@ class Conditional > > @boolSettings = @settings.select { |setting| setting.type == "bool" } > @nonBoolSettings = @settings.reject { |setting| setting.type == "bool" } >+ @settingsWithComplexGetters = @settings.select { |setting| setting.hasComplexGetter? } > @settingsWithComplexSetters = @settings.select { |setting| setting.hasComplexSetter? } > end > end >@@ -148,6 +160,7 @@ class Settings > attr_accessor :unconditionalSetting > attr_accessor :unconditionalBoolSetting > attr_accessor :unconditionalNonBoolSetting >+ attr_accessor :unconditionalSettingWithComplexGetters > attr_accessor :unconditionalSettingWithComplexSetters > attr_accessor :conditionals > >@@ -161,7 +174,9 @@ class Settings > @unconditionalSetting = @settings.reject { |setting| setting.conditional } > @unconditionalBoolSetting = @unconditionalSetting.select { |setting| setting.type == "bool" } > @unconditionalNonBoolSetting = @unconditionalSetting.reject { |setting| setting.type == "bool" } >+ @unconditionalSettingWithComplexGetters = @unconditionalSetting.select { |setting| setting.hasComplexGetter? } > @unconditionalSettingWithComplexSetters = @unconditionalSetting.select { |setting| setting.hasComplexSetter? } >+ @inspectorOverrideSettings = @settings.select { |setting| setting.hasInspectorOverride? } > > @conditionals = [] > conditionalsMap = {} >diff --git a/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb b/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb >index 1ff7e9347f77b6d2faa1e70f474643eea2f03d88..c56e7ae7d4f0faa39adcd1982a5ec2efc52af461 100644 >--- a/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb >+++ b/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb >@@ -71,6 +71,17 @@ Settings::~Settings() > { > } > >+<%- for @setting in @unconditionalSettingWithComplexGetters do -%> >+<%= @setting.parameterType %> Settings::<%= @setting.getterFunctionName %>() const >+{ >+<%- if @setting.hasInspectorOverride? -%> >+ if (m_<%= @setting.name %>InspectorOverride) >+ return m_<%= @setting.name %>InspectorOverride.value(); >+<%- end -%> >+ return m_<%= @setting.name %>; >+} >+ >+<%- end -%> > <%- for @setting in @unconditionalSettingWithComplexSetters do -%> > void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>) > { >@@ -82,8 +93,18 @@ void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> > > <%- end -%> > <%- for @conditional in @conditionals do -%> >-<%- if @conditional.settingsWithComplexSetters.length != 0 -%> >+<%- if @conditional.settingsWithComplexGetters.length != 0 or @conditional.settingsWithComplexSetters.length != 0-%> > #if ENABLE(<%= @conditional.condition %>) >+<%- for @setting in @conditional.settingsWithComplexGetters do -%> >+<%= @setting.parameterType %> Settings::<%= @setting.getterFunctionName %>() const >+{ >+<%- if @setting.hasInspectorOverride? -%> >+ if (m_<%= @setting.name %>InspectorOverride) >+ return m_<%= @setting.name %>InspectorOverride.value(); >+<%- end -%> >+ return m_<%= @setting.name %>; >+} >+<%- end -%> > <%- for @setting in @conditional.settingsWithComplexSetters -%> > void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>) > { >@@ -95,6 +116,18 @@ void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> > <%- end -%> > #endif > >+<%- end -%> >+<%- end -%> >+<%- for @setting in @inspectorOverrideSettings do -%> >+<%- if @setting.hasComplexSetter? -%> >+void Settings::<%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>> <%= @setting.name %>InspectorOverride) >+{ >+ if (m_<%= @setting.name %>InspectorOverride == <%= @setting.name %>InspectorOverride) >+ return; >+ m_<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride; >+ <%= @setting.onChange %>(); >+} >+ > <%- end -%> > <%- end -%> > } >diff --git a/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb b/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb >index c98c845e76547b06a81f2478632b0f16131dbcb3..2d528cd64933a64144621ac7e41669ab15c4ed70 100644 >--- a/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb >+++ b/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb >@@ -41,7 +41,11 @@ public: > ~Settings(); > > <%- for @setting in @unconditionalSetting do -%> >+ <%- if @setting.hasComplexGetter? -%> >+ WEBCORE_EXPORT <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const; >+ <%- else -%> > <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const { return m_<%= @setting.name %>; } >+ <%- end -%> > <%- if @setting.hasComplexSetter? -%> > WEBCORE_EXPORT void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %>); > <%- else -%> >@@ -52,7 +56,11 @@ public: > <%- for @conditional in @conditionals do -%> > #if ENABLE(<%= @conditional.condition %>) > <%- for @setting in @conditional.settings do -%> >+ <%- if @setting.hasComplexGetter? -%> >+ WEBCORE_EXPORT <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const; >+ <%- else -%> > <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const { return m_<%= @setting.name %>; } >+ <%- end -%> > <%- if @setting.hasComplexSetter? -%> > WEBCORE_EXPORT void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %>); > <%- else -%> >@@ -62,10 +70,21 @@ public: > #endif > > <%- end -%> >+<%- for @setting in @inspectorOverrideSettings do -%> >+ <%- if @setting.hasComplexSetter? -%> >+ WEBCORE_EXPORT void <%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>>); >+ <%- else -%> >+ void <%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>> <%= @setting.name %>InspectorOverride) { m_<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride; } >+ <%- end -%> >+<%- end -%> > > private: > explicit Settings(Page*); > >+<%- for @setting in @inspectorOverrideSettings do -%> >+ Optional<<%= @setting.type %>> m_<%= @setting.name %>InspectorOverride; >+<%- end -%> >+ > <%- for @setting in @unconditionalNonBoolSetting do -%> > <%= @setting.type %> m_<%= @setting.name %>; > <%- end -%> >diff --git a/Source/WebCore/inspector/InspectorFrontendClient.h b/Source/WebCore/inspector/InspectorFrontendClient.h >index 9fd954bac43c7b09b447d1340863161727dc6183..38659886737a3070ace7f79752c595b825e413f8 100644 >--- a/Source/WebCore/inspector/InspectorFrontendClient.h >+++ b/Source/WebCore/inspector/InspectorFrontendClient.h >@@ -54,6 +54,7 @@ public: > virtual void startWindowDrag() = 0; > virtual void moveWindowBy(float x, float y) = 0; > >+ virtual bool isRemote() const = 0; > virtual String localizedStringsURL() = 0; > virtual unsigned inspectionLevel() const = 0; > virtual String backendCommandsURL() { return String(); }; >diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.h b/Source/WebCore/inspector/InspectorFrontendClientLocal.h >index 248ea1f105491c9e6ab17d3da77b79065db0bbd5..5139eee16b569de1298f9dba9ddc07a5c66e8c30 100644 >--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.h >+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.h >@@ -81,6 +81,7 @@ public: > WEBCORE_EXPORT void sendMessageToBackend(const String& message) final; > > WEBCORE_EXPORT bool isUnderTest() final; >+ bool isRemote() const final { return false; } > WEBCORE_EXPORT unsigned inspectionLevel() const final; > > WEBCORE_EXPORT bool canAttachWindow(); >diff --git a/Source/WebCore/inspector/InspectorFrontendHost.cpp b/Source/WebCore/inspector/InspectorFrontendHost.cpp >index 15b8dc0809a0f6fd649d15e2a8be605b8bb94cdb..5368e74650071bf84951fa8c46733c92174336ef 100644 >--- a/Source/WebCore/inspector/InspectorFrontendHost.cpp >+++ b/Source/WebCore/inspector/InspectorFrontendHost.cpp >@@ -254,6 +254,11 @@ void InspectorFrontendHost::moveWindowBy(float x, float y) const > m_client->moveWindowBy(x, y); > } > >+bool InspectorFrontendHost::isRemote() const >+{ >+ return m_client ? m_client->isRemote() : false; >+} >+ > String InspectorFrontendHost::localizedStringsURL() > { > return m_client ? m_client->localizedStringsURL() : String(); >diff --git a/Source/WebCore/inspector/InspectorFrontendHost.h b/Source/WebCore/inspector/InspectorFrontendHost.h >index 5242cc689463bdddbe8846f60ee7ae613bcacc10..76a6fb4d3919b5d07a7a591350f6fa7cf3160de4 100644 >--- a/Source/WebCore/inspector/InspectorFrontendHost.h >+++ b/Source/WebCore/inspector/InspectorFrontendHost.h >@@ -75,6 +75,7 @@ public: > void startWindowDrag(); > void moveWindowBy(float x, float y) const; > >+ bool isRemote() const; > String localizedStringsURL(); > String backendCommandsURL(); > String debuggableType(); >diff --git a/Source/WebCore/inspector/InspectorFrontendHost.idl b/Source/WebCore/inspector/InspectorFrontendHost.idl >index c7cbf9d110a205a47969f341d16831c5f5e49227..b1e4debfa6ce46916b1acb783f2f8a5b4480352b 100644 >--- a/Source/WebCore/inspector/InspectorFrontendHost.idl >+++ b/Source/WebCore/inspector/InspectorFrontendHost.idl >@@ -56,6 +56,7 @@ > void startWindowDrag(); > void moveWindowBy(unrestricted float x, unrestricted float y); > >+ readonly attribute boolean isRemote; > DOMString localizedStringsURL(); > DOMString backendCommandsURL(); > DOMString debuggableType(); >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >index 106bd4355dd2618aa4050d0505a0a4b9022ffd4a..8dd8491f8c9265fd86170bdc4a24d453927b9e9a 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >@@ -83,6 +83,13 @@ namespace WebCore { > > using namespace Inspector; > >+#define FOR_EACH_INSPECTOR_OVERRIDE_SETTING(macro) \ >+ macro(AuthorAndUserStylesEnabled) \ >+ macro(ImagesEnabled) \ >+ macro(NeedsSiteSpecificQuirks) \ >+ macro(ScriptEnabled) \ >+ macro(WebSecurityEnabled) >+ > static bool decodeBuffer(const char* buffer, unsigned size, const String& textEncodingName, String* result) > { > if (buffer) { >@@ -315,6 +322,13 @@ void InspectorPageAgent::disable(ErrorString&) > setShowPaintRects(unused, false); > setEmulatedMedia(unused, emptyString()); > setForcedAppearance(unused, emptyString()); >+ >+#define DISABLE_INSPECTOR_OVERRIDE_SETTING(name) \ >+ m_page.settings().set##name##InspectorOverride(WTF::nullopt); >+ >+ FOR_EACH_INSPECTOR_OVERRIDE_SETTING(DISABLE_INSPECTOR_OVERRIDE_SETTING) >+ >+#undef DISABLE_INSPECTOR_OVERRIDE_SETTING > } > > void InspectorPageAgent::reload(ErrorString&, const bool* optionalReloadFromOrigin, const bool* optionalRevalidateAllResources) >@@ -341,6 +355,37 @@ void InspectorPageAgent::navigate(ErrorString&, const String& url) > frame.loader().changeLocation(WTFMove(frameLoadRequest)); > } > >+void InspectorPageAgent::overrideSetting(ErrorString& errorString, const String& settingString, const bool* value) >+{ >+ if (settingString.isEmpty()) { >+ errorString = "Preference is empty"_s; >+ return; >+ } >+ >+ auto setting = Inspector::Protocol::InspectorHelpers::parseEnumValueFromString<Inspector::Protocol::Page::Setting>(settingString); >+ if (!setting) { >+ errorString = makeString("Unknown setting: "_s, settingString); >+ return; >+ } >+ >+ switch (setting.value()) { >+#define CASE_INSPECTOR_OVERRIDE_SETTING(name) \ >+ case Inspector::Protocol::Page::Setting::name: { \ >+ if (value) \ >+ m_page.settings().set##name##InspectorOverride(*value); \ >+ else \ >+ m_page.settings().set##name##InspectorOverride(WTF::nullopt); \ >+ return; \ >+ } \ >+ >+ FOR_EACH_INSPECTOR_OVERRIDE_SETTING(CASE_INSPECTOR_OVERRIDE_SETTING) >+ >+#undef CASE_INSPECTOR_OVERRIDE_SETTING >+ } >+ >+ ASSERT_NOT_REACHED(); >+} >+ > static Inspector::Protocol::Page::CookieSameSitePolicy cookieSameSitePolicyJSON(Cookie::SameSitePolicy policy) > { > switch (policy) { >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h >index e1a1da99f244879ee31175ac33140170245a1e47..41b7e07ae260b343c65b021f80e5ab1dac9ea852 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h >@@ -90,6 +90,7 @@ public: > void disable(ErrorString&) final; > void reload(ErrorString&, const bool* optionalReloadFromOrigin, const bool* optionalRevalidateAllResources) final; > void navigate(ErrorString&, const String& url) final; >+ void overrideSetting(ErrorString&, const String& setting, const bool* value) final; > void getCookies(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>& cookies) final; > void deleteCookie(ErrorString&, const String& cookieName, const String& url) final; > void getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>&) final; >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 9b9a6e87c6acdf5b188e9dbc3c1ff3967db02a60..ccf7d73cd2cdce38580249616b42dd7420bc9a95 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -128,6 +128,7 @@ textAreasAreResizable: > authorAndUserStylesEnabled: > initial: true > onChange: setNeedsRecalcStyleInAllFrames >+ inspectorOverride: true > userStyleSheetLocation: > type: URL > onChange: userStyleSheetLocationChanged >@@ -179,6 +180,7 @@ scriptMarkupEnabled: > initial: true > needsSiteSpecificQuirks: > initial: false >+ inspectorOverride: true > domTimersThrottlingEnabled: > initial: true > webArchiveDebugModeEnabled: >@@ -385,6 +387,7 @@ asyncOverflowScrollingEnabled: > > webSecurityEnabled: > initial: true >+ inspectorOverride: true > spatialNavigationEnabled: > initial: false > >@@ -669,9 +672,11 @@ imagesEnabled: > initial: true > getter: areImagesEnabled > onChange: imagesEnabledChanged >+ inspectorOverride: true > scriptEnabled: > initial: false > getter: isScriptEnabled >+ inspectorOverride: true > pluginsEnabled: > initial: false > getter: arePluginsEnabled >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index a6ac3b2ca2d6546e686146245cb351a03b66c5ed..c0ff3153fb33e643673297900195c8421793b1f1 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -295,8 +295,13 @@ localizedStrings["Details"] = "Details"; > localizedStrings["Dimensions"] = "Dimensions"; > localizedStrings["Disable Breakpoint"] = "Disable Breakpoint"; > localizedStrings["Disable Breakpoints"] = "Disable Breakpoints"; >+localizedStrings["Disable Cross-Origin Restrictions"] = "Disable Cross-Origin Restrictions"; > localizedStrings["Disable Event Listener"] = "Disable Event Listener"; >+localizedStrings["Disable Images"] = "Disable Images"; >+localizedStrings["Disable JavaScript"] = "Disable JavaScript"; > localizedStrings["Disable Program"] = "Disable Program"; >+localizedStrings["Disable Site-specific Hacks"] = "Disable Site-specific Hacks"; >+localizedStrings["Disable Styles"] = "Disable Styles"; > localizedStrings["Disable all breakpoints (%s)"] = "Disable all breakpoints (%s)"; > localizedStrings["Disable paint flashing"] = "Disable paint flashing"; > localizedStrings["Disabled"] = "Disabled"; >@@ -663,6 +668,7 @@ localizedStrings["Outgoing message"] = "Outgoing message"; > localizedStrings["Output: "] = "Output: "; > localizedStrings["Over 1 ms"] = "Over 1 ms"; > localizedStrings["Over 15 ms"] = "Over 15 ms"; >+localizedStrings["Override Page Settings"] = "Override Page Settings"; > localizedStrings["Overview"] = "Overview"; > localizedStrings["Owns"] = "Owns"; > localizedStrings["Page"] = "Page"; >diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js >index 81b06dd502e8ae5793ca26cc1745f07fc2eb3e6a..0396fba6d3de24b65ad1a76e2c00540b6bdffcd6 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Main.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js >@@ -158,6 +158,7 @@ WI.loaded = function() > this.visible = false; > this._windowKeydownListeners = []; > this._targetsAvailablePromise = new WI.WrappedPromise; >+ this._overridenPageSettings = new Set; > > // Targets. > WI.backendTarget = null; >@@ -442,6 +443,12 @@ WI.contentLoaded = function() > this._inspectModeToolbarButton = new WI.ActivateButtonToolbarItem("inspect", elementSelectionToolTip, activatedElementSelectionToolTip, "Images/Crosshair.svg"); > this._inspectModeToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleInspectMode, this); > >+ if (InspectorFrontendHost.isRemote && WI.sharedApp.debuggableType === WI.DebuggableType.Web && InspectorBackend.domains.Page && InspectorBackend.domains.Page.overrideSetting) { >+ const overridePageSettingsTooltip = WI.UIString("Override Page Settings"); >+ this._overridePageSettingsToolbarButton = new WI.ActivateButtonToolbarItem("override-page-settings", overridePageSettingsTooltip, overridePageSettingsTooltip, "Images/Gear.svg"); >+ this._overridePageSettingsToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._handleOverridePageSettingsToolbarButtonClicked, this); >+ } >+ > this._updateReloadToolbarButton(); > this._updateDownloadToolbarButton(); > this._updateInspectModeToolbarButton(); >@@ -467,6 +474,9 @@ WI.contentLoaded = function() > > this.toolbar.addToolbarItem(this._inspectModeToolbarButton, WI.Toolbar.Section.CenterRight); > >+ if (this._overridePageSettingsToolbarButton) >+ this.toolbar.addToolbarItem(this._overridePageSettingsToolbarButton, WI.Toolbar.Section.CenterRight); >+ > this._searchTabContentView = new WI.SearchTabContentView; > > if (WI.settings.experimentalEnableNewTabBar.value) { >@@ -575,6 +585,12 @@ WI.contentLoaded = function() > > WI.performOneTimeFrontendInitializationsUsingTarget = function(target) > { >+ if (!WI.__didPerformPageInitialization && target.PageAgent) { >+ WI.__didPerformPageInitialization = true; >+ for (let setting of this._overridenPageSettings) >+ target.PageAgent.overrideSetting(setting, true); >+ } >+ > if (!WI.__didPerformConsoleInitialization && target.ConsoleAgent) { > WI.__didPerformConsoleInitialization = true; > WI.consoleManager.initializeLogChannels(target); >@@ -1913,6 +1929,57 @@ WI._toggleInspectMode = function(event) > this.domManager.inspectModeEnabled = !this.domManager.inspectModeEnabled; > }; > >+WI._handleOverridePageSettingsToolbarButtonClicked = function(event) >+{ >+ let updateActivatedState = () => { >+ this._overridePageSettingsToolbarButton.activated = this._overridenPageSettings.size > 0; >+ }; >+ >+ let contextMenu = WI.ContextMenu.createFromEvent(event.data.nativeEvent); >+ >+ let addCheckbox = (label, setting) => { >+ if (!setting) >+ return; >+ >+ let enabled = this._overridenPageSettings.has(setting); >+ >+ contextMenu.appendCheckboxItem(label, () => { >+ if (enabled) { >+ // We're about to override to `true`, so clear the override instead of applying it. >+ PageAgent.overrideSetting(setting, (error) => { >+ if (error) { >+ console.error(error); >+ return; >+ } >+ >+ this._overridenPageSettings.delete(setting); >+ updateActivatedState(); >+ }); >+ >+ } else { >+ // Override to false since the labels are the inverse of the setting. >+ const value = false; >+ PageAgent.overrideSetting(setting, value, (error) => { >+ if (error) { >+ console.error(error); >+ return; >+ } >+ >+ this._overridenPageSettings.add(setting); >+ updateActivatedState(); >+ }); >+ } >+ }, enabled); >+ }; >+ addCheckbox(WI.UIString("Disable Images"), PageAgent.Setting.ImagesEnabled); >+ addCheckbox(WI.UIString("Disable Styles"), PageAgent.Setting.AuthorAndUserStylesEnabled); >+ addCheckbox(WI.UIString("Disable JavaScript"), PageAgent.Setting.ScriptEnabled); >+ addCheckbox(WI.UIString("Disable Site-specific Hacks"), PageAgent.Setting.NeedsSiteSpecificQuirks); >+ addCheckbox(WI.UIString("Disable Cross-Origin Restrictions"), PageAgent.Setting.WebSecurityEnabled); >+ >+ contextMenu.show(); >+}; >+ > WI._downloadWebArchive = function(event) > { > this.archiveMainFrame(); >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h b/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h >index f6e17f911220d8d3f4e346689c74ac199c4106e7..f9b67b31fcfd049848f40fc7f8f4de758e681830 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h >+++ b/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h >@@ -58,6 +58,7 @@ public: > void startWindowDrag() override; > void moveWindowBy(float x, float y) override; > >+ bool isRemote() const final { return true; } > String localizedStringsURL() override; > String backendCommandsURL() override { return m_backendCommandsURL; } > String debuggableType() override { return m_debuggableType; } >diff --git a/Source/WebKit/WebProcess/WebPage/WebInspectorUI.h b/Source/WebKit/WebProcess/WebPage/WebInspectorUI.h >index 243d48713fc8ed3a91d46e93421bfbd67c804f98..b1537dbad0bce12be51f1f4973da6e7a018532a8 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebInspectorUI.h >+++ b/Source/WebKit/WebProcess/WebPage/WebInspectorUI.h >@@ -88,6 +88,7 @@ public: > void startWindowDrag() override; > void moveWindowBy(float x, float y) override; > >+ bool isRemote() const final { return false; } > String localizedStringsURL() override; > > void bringToFront() override;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193813
:
360080
|
360081
|
360189
|
360190
|
360208