WebKit Bugzilla
Attachment 360257 Details for
Bug 193863
: Web Inspector: provide a way to edit page WebRTC 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-193863-20190126152928.patch (text/plain), 27.34 KB, created by
Devin Rousso
on 2019-01-26 15:29:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-26 15:29:29 PST
Size:
27.34 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 64b553ed70d30bc84e1b306ae116da25e7ddecb3..7046ca097fa6e12647375a788ce41486c2aca3fa 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-26 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/protocol/Page.json: >+ Add more values to the `Setting` enum type: >+ - `ICECandidateFilteringEnabled` >+ - `MediaCaptureRequiresSecureConnection` >+ - `MockCaptureDevicesEnabled` >+ > 2019-01-26 Devin Rousso <drousso@apple.com> > > Web Inspector: provide a way to edit the user agent of a remote target >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6bd8de6ee1f659b3aad59ce16ada5b68c256dfe0..8fa5f39b18eed43e633ad51c6bdab7b55386fa83 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,42 @@ >+2019-01-26 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No change in functionality when there is no connected Web Inspector. >+ >+ * inspector/agents/InspectorPageAgent.cpp: >+ (WebCore::InspectorPageAgent::disable): >+ (WebCore::InspectorPageAgent::overrideSetting): >+ >+ * page/Settings.yaml: >+ * page/SettingsBase.h: >+ * page/SettingsBase.cpp: >+ (SettingsBase::mockCaptureDevicesEnabledChanged): Added. >+ Add page-level settings for WebRTC preferences. >+ >+ * Modules/mediastream/UserMediaController.cpp: >+ (WebCore::UserMediaController::canCallGetUserMedia): >+ >+ * testing/InternalSettings.cpp: >+ (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection): >+ >+ * testing/Internals.h: >+ * testing/Internals.cpp: >+ (WebCore::Internals::Internals): >+ (WebCore::Internals::setMockMediaCaptureDevicesEnabled): >+ (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added. >+ >+ * page/DeprecatedGlobalSettings.h: >+ * page/DeprecatedGlobalSettings.cpp: >+ (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted. >+ (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted. >+ (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted. >+ (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted. >+ > 2019-01-26 Devin Rousso <drousso@apple.com> > > Web Inspector: provide a way to edit the user agent of a remote target >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index d44512a4776c90aacb84c787f230d86211d886e7..042aed6befa8e44d3ce109f292329ee46ceabd6f 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-26 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Base/Main.js: >+ (WI._handleDeviceSettingsToolbarButtonClicked): >+ (WI._handleDeviceSettingsToolbarButtonClicked.createCheckbox): >+ * UserInterface/Views/Main.css: >+ (.device-settings-content .container): Added. >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2019-01-26 Devin Rousso <drousso@apple.com> > > Web Inspector: provide a way to edit the user agent of a remote target >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6aae160ba07f1b6ecb14a86ac29d0a3111717493..662649b6d7f8092df1e8aed317b0011886ff2e52 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-26 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebPreferences.yaml: >+ * Shared/WebPreferencesDefaultValues.h: >+ Add page-level settings for WebRTC preferences. >+ > 2019-01-25 Tim Horton <timothy_horton@apple.com> > > REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 3c6d71db37f7ba5bc917c242e8aa5f098e327462..85e39b914d34558ebb973602275622e756267365 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-26 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to edit page WebRTC settings on a remote target >+ https://bugs.webkit.org/show_bug.cgi?id=193863 >+ <rdar://problem/47572764> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebView.mm: >+ (-[WebView _preferencesChanged:]): >+ Add page-level settings for WebRTC preferences. >+ > 2019-01-25 Keith Rollin <krollin@apple.com> > > Update WebKitAdditions.xcconfig with correct order of variable definitions >diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json >index 7142a0e582ea6a20049c0268d40a62639410ab43..769bf4b3b8f98e6c4ed39f5506955727e72f0815 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Page.json >+++ b/Source/JavaScriptCore/inspector/protocol/Page.json >@@ -9,7 +9,10 @@ > "description": "List of settings able to be overridden by WebInspector. Keep this in sync with FOR_EACH_INSPECTOR_OVERRIDE_SETTING.", > "enum": [ > "AuthorAndUserStylesEnabled", >+ "ICECandidateFilteringEnabled", > "ImagesEnabled", >+ "MediaCaptureRequiresSecureConnection", >+ "MockCaptureDevicesEnabled", > "NeedsSiteSpecificQuirks", > "ScriptEnabled", > "WebSecurityEnabled" >diff --git a/Source/WebCore/Modules/mediastream/UserMediaController.cpp b/Source/WebCore/Modules/mediastream/UserMediaController.cpp >index 6251a7ec05da629b8b450dbe37396ce8be866ce5..21ea1b574b481a89c968bdc80db8394a27ffbd55 100644 >--- a/Source/WebCore/Modules/mediastream/UserMediaController.cpp >+++ b/Source/WebCore/Modules/mediastream/UserMediaController.cpp >@@ -29,13 +29,13 @@ > #if ENABLE(MEDIA_STREAM) > > #include "DOMWindow.h" >-#include "DeprecatedGlobalSettings.h" > #include "Document.h" > #include "DocumentLoader.h" > #include "Frame.h" > #include "HTMLIFrameElement.h" > #include "HTMLParserIdioms.h" > #include "SchemeRegistry.h" >+#include "Settings.h" > #include "UserMediaRequest.h" > > namespace WebCore { >@@ -113,7 +113,9 @@ UserMediaController::GetUserMediaAccess UserMediaController::canCallGetUserMedia > { > ASSERT(!types.isEmpty()); > >- bool requiresSecureConnection = DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection(); >+ bool requiresSecureConnection = true; >+ if (auto page = document.page()) >+ requiresSecureConnection = page->settings().mediaCaptureRequiresSecureConnection(); > auto& documentLoader = *document.loader(); > if (requiresSecureConnection && !isSecure(documentLoader)) > return GetUserMediaAccess::InsecureDocument; >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >index 6cd1fd7e252c8daf6ff1e9c89e592dad709ea1e7..20bc5a79a9ab694ee0d6d0e2c94d1a078ee4d3ab 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >@@ -83,9 +83,12 @@ namespace WebCore { > > using namespace Inspector; > >+// Keep this in sync with Page.Setting > #define FOR_EACH_INSPECTOR_OVERRIDE_SETTING(macro) \ > macro(AuthorAndUserStylesEnabled) \ > macro(ImagesEnabled) \ >+ macro(MediaCaptureRequiresSecureConnection) \ >+ macro(MockCaptureDevicesEnabled) \ > macro(NeedsSiteSpecificQuirks) \ > macro(ScriptEnabled) \ > macro(WebSecurityEnabled) >@@ -330,6 +333,8 @@ void InspectorPageAgent::disable(ErrorString&) > FOR_EACH_INSPECTOR_OVERRIDE_SETTING(DISABLE_INSPECTOR_OVERRIDE_SETTING) > > #undef DISABLE_INSPECTOR_OVERRIDE_SETTING >+ >+ m_page.enableICECandidateFiltering(); > } > > void InspectorPageAgent::reload(ErrorString&, const bool* optionalReloadFromOrigin, const bool* optionalRevalidateAllResources) >@@ -387,6 +392,13 @@ void InspectorPageAgent::overrideSetting(ErrorString& errorString, const String& > FOR_EACH_INSPECTOR_OVERRIDE_SETTING(CASE_INSPECTOR_OVERRIDE_SETTING) > > #undef CASE_INSPECTOR_OVERRIDE_SETTING >+ >+ case Inspector::Protocol::Page::Setting::ICECandidateFilteringEnabled: { >+ if (value && !*value) >+ m_page.disableICECandidateFiltering(); >+ else >+ m_page.enableICECandidateFiltering(); >+ } > } > > ASSERT_NOT_REACHED(); >diff --git a/Source/WebCore/page/DeprecatedGlobalSettings.cpp b/Source/WebCore/page/DeprecatedGlobalSettings.cpp >index f4995d3870c2bda06e13f019f9de5ec203059eff..cf4ccc80e93936d568cd550e028b68152eb94d2d 100644 >--- a/Source/WebCore/page/DeprecatedGlobalSettings.cpp >+++ b/Source/WebCore/page/DeprecatedGlobalSettings.cpp >@@ -31,11 +31,6 @@ > #include "RuntimeApplicationChecks.h" > #include <wtf/NeverDestroyed.h> > >-#if ENABLE(MEDIA_STREAM) >-#include "MockRealtimeMediaSourceCenter.h" >- >-#endif >- > namespace WebCore { > > #if USE(AVFOUNDATION) >@@ -51,11 +46,6 @@ bool DeprecatedGlobalSettings::gMockScrollbarsEnabled = false; > bool DeprecatedGlobalSettings::gUsesOverlayScrollbars = false; > bool DeprecatedGlobalSettings::gMockScrollAnimatorEnabled = false; > >-#if ENABLE(MEDIA_STREAM) >-bool DeprecatedGlobalSettings::gMockCaptureDevicesEnabled = false; >-bool DeprecatedGlobalSettings::gMediaCaptureRequiresSecureConnection = true; >-#endif >- > #if PLATFORM(WIN) > bool DeprecatedGlobalSettings::gShouldUseHighResolutionTimers = true; > #endif >@@ -113,29 +103,6 @@ void DeprecatedGlobalSettings::setGStreamerEnabled(bool enabled) > } > #endif > >-#if ENABLE(MEDIA_STREAM) >-bool DeprecatedGlobalSettings::mockCaptureDevicesEnabled() >-{ >- return gMockCaptureDevicesEnabled; >-} >- >-void DeprecatedGlobalSettings::setMockCaptureDevicesEnabled(bool enabled) >-{ >- gMockCaptureDevicesEnabled = enabled; >- MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(enabled); >-} >- >-bool DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection() >-{ >- return gMediaCaptureRequiresSecureConnection; >-} >- >-void DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(bool mediaCaptureRequiresSecureConnection) >-{ >- gMediaCaptureRequiresSecureConnection = mediaCaptureRequiresSecureConnection; >-} >-#endif >- > // It's very important that this setting doesn't change in the middle of a document's lifetime. > // The Mac port uses this flag when registering and deregistering platform-dependent scrollbar > // objects. Therefore, if this changes at an unexpected time, deregistration may not happen >diff --git a/Source/WebCore/page/DeprecatedGlobalSettings.h b/Source/WebCore/page/DeprecatedGlobalSettings.h >index 216da09f87de45a7d7216b2965fe1291a191e7bf..620d12a18aef92a62d5fc74a7c3aab7a976e7944 100644 >--- a/Source/WebCore/page/DeprecatedGlobalSettings.h >+++ b/Source/WebCore/page/DeprecatedGlobalSettings.h >@@ -103,14 +103,6 @@ public: > static void setShouldManageAudioSessionCategory(bool flag) { gManageAudioSession = flag; } > static bool shouldManageAudioSessionCategory() { return gManageAudioSession; } > #endif >- >-#if ENABLE(MEDIA_STREAM) >- static bool mockCaptureDevicesEnabled(); >- WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool); >- >- static bool mediaCaptureRequiresSecureConnection(); >- WEBCORE_EXPORT static void setMediaCaptureRequiresSecureConnection(bool); >-#endif > > WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool); > static bool allowsAnySSLCertificate(); >@@ -140,11 +132,6 @@ private: > WEBCORE_EXPORT static bool gDisableScreenSizeOverride; > #endif > WEBCORE_EXPORT static bool gManageAudioSession; >- >-#if ENABLE(MEDIA_STREAM) >- static bool gMockCaptureDevicesEnabled; >- static bool gMediaCaptureRequiresSecureConnection; >-#endif > > static bool gLowPowerVideoAudioBufferSizeEnabled; > static bool gResourceLoadStatisticsEnabledEnabled; >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index ca4c57c869f4950881ba840d8bb649102eb3257e..b5447de7565d0e5343022d9f6bf6d108aebf5a69 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -796,3 +796,16 @@ editableImagesEnabled: > > adClickAttributionEnabled: > initial: false >+ >+# Deprecated >+ >+mockCaptureDevicesEnabled: >+ initial: false >+ conditional: MEDIA_STREAM >+ onChange: mockCaptureDevicesEnabledChanged >+ inspectorOverride: true >+ >+mediaCaptureRequiresSecureConnection: >+ initial: true >+ conditional: MEDIA_STREAM >+ inspectorOverride: true >diff --git a/Source/WebCore/page/SettingsBase.cpp b/Source/WebCore/page/SettingsBase.cpp >index cd4c4e8118f151520a2c02b2b41343fcedd2e782..aab41d12317a05bc311826b0eaaeae3df74f41bf 100644 >--- a/Source/WebCore/page/SettingsBase.cpp >+++ b/Source/WebCore/page/SettingsBase.cpp >@@ -48,6 +48,10 @@ > #include <limits> > #include <wtf/StdLibExtras.h> > >+#if ENABLE(MEDIA_STREAM) >+#include "MockRealtimeMediaSourceCenter.h" >+#endif >+ > namespace WebCore { > > static void invalidateAfterGenericFamilyChange(Page* page) >@@ -314,6 +318,17 @@ void SettingsBase::shouldEnableTextAutosizingBoostChanged() > > #endif > >+#if ENABLE(MEDIA_STREAM) >+void SettingsBase::mockCaptureDevicesEnabledChanged() >+{ >+ bool enabled = false; >+ if (m_page) >+ enabled = m_page->settings().mockCaptureDevicesEnabled(); >+ >+ MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(enabled); >+} >+#endif >+ > void SettingsBase::userStyleSheetLocationChanged() > { > if (m_page) >diff --git a/Source/WebCore/page/SettingsBase.h b/Source/WebCore/page/SettingsBase.h >index d6471c24d9ebc70da937afab59bcbad01e119dfd..c720c7f81152755795d030374cfec0f5048f5745 100644 >--- a/Source/WebCore/page/SettingsBase.h >+++ b/Source/WebCore/page/SettingsBase.h >@@ -191,6 +191,9 @@ protected: > #if ENABLE(TEXT_AUTOSIZING) > void shouldEnableTextAutosizingBoostChanged(); > #endif >+#if ENABLE(MEDIA_STREAM) >+ void mockCaptureDevicesEnabledChanged(); >+#endif > > Page* m_page; > >diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp >index 6f7e519630954856bfcf95d75b993db88946c3f2..5dfb065056d47ab178234c06e359fff4499b32a3 100644 >--- a/Source/WebCore/testing/InternalSettings.cpp >+++ b/Source/WebCore/testing/InternalSettings.cpp >@@ -462,7 +462,7 @@ ExceptionOr<void> InternalSettings::setMediaCaptureRequiresSecureConnection(bool > if (!m_page) > return Exception { InvalidAccessError }; > #if ENABLE(MEDIA_STREAM) >- DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(requires); >+ m_page->settings().setMediaCaptureRequiresSecureConnection(requires); > #else > UNUSED_PARAM(requires); > #endif >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 1c84704b7b3965298a872894bcfad2e12b4da602..4856f7f94604ab92f20efe8509d36ffa1cafd81b 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -534,7 +534,7 @@ Internals::Internals(Document& document) > > #if ENABLE(MEDIA_STREAM) > setMockMediaCaptureDevicesEnabled(true); >- WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(false); >+ setMediaCaptureRequiresSecureConnection(false); > #endif > > #if ENABLE(WIRELESS_PLAYBACK_TARGET) >@@ -1472,7 +1472,16 @@ void Internals::applyRotationForOutgoingVideoSources(RTCPeerConnection& connecti > > void Internals::setMockMediaCaptureDevicesEnabled(bool enabled) > { >- WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled(enabled); >+ Document* document = contextDocument(); >+ if (auto* page = document->page()) >+ page->settings().setMockCaptureDevicesEnabled(enabled); >+} >+ >+void Internals::setMediaCaptureRequiresSecureConnection(bool enabled) >+{ >+ Document* document = contextDocument(); >+ if (auto* page = document->page()) >+ page->settings().setMediaCaptureRequiresSecureConnection(enabled); > } > > static std::unique_ptr<MediaRecorderPrivate> createRecorderMockSource() >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index f70b7b6b93e7bf017364036002da4686a6eece94..37c5490d477ff54852a1400bb24975ffed86b429 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -507,6 +507,7 @@ public: > > #if ENABLE(MEDIA_STREAM) > void setMockMediaCaptureDevicesEnabled(bool); >+ void setMediaCaptureRequiresSecureConnection(bool); > void setCustomPrivateRecorderCreator(); > #endif > >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index bf92bafb669cd61242f3c629d9fde46533667564..a9842da4a54ba4aa5069df56f5a11689442374b6 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -59,6 +59,7 @@ localizedStrings["%s cannot be modified"] = "%s cannot be modified"; > localizedStrings["%s delay"] = "%s delay"; > localizedStrings["%s eval\n%s async"] = "%s eval\n%s async"; > localizedStrings["%s interval"] = "%s interval"; >+localizedStrings["%s:"] = "%s:"; > localizedStrings["(Action %s)"] = "(Action %s)"; > localizedStrings["(Disk)"] = "(Disk)"; > localizedStrings["(Index)"] = "(Index)"; >@@ -104,6 +105,7 @@ localizedStrings["All Storage"] = "All Storage"; > localizedStrings["All items in \u0022%s\u0022 must be error objects"] = "All items in \u0022%s\u0022 must be error objects"; > localizedStrings["All items in \u0022%s\u0022 must be non-empty strings"] = "All items in \u0022%s\u0022 must be non-empty strings"; > localizedStrings["All items in \u0022%s\u0022 must be valid DOM nodes"] = "All items in \u0022%s\u0022 must be valid DOM nodes"; >+localizedStrings["Allow Media Capture on Insecure Sites"] = "Allow Media Capture on Insecure Sites"; > localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource."; > localizedStrings["An error occurred trying to read the \u201C%s\u201D table."] = "An error occurred trying to read the \u201C%s\u201D table."; > localizedStrings["An unexpected error %s occurred."] = "An unexpected error %s occurred."; >@@ -302,6 +304,7 @@ localizedStrings["Dimensions"] = "Dimensions"; > localizedStrings["Disable Breakpoint"] = "Disable Breakpoint"; > localizedStrings["Disable Breakpoints"] = "Disable Breakpoints"; > localizedStrings["Disable Event Listener"] = "Disable Event Listener"; >+localizedStrings["Disable ICE Candidate Restrictions"] = "Disable ICE Candidate Restrictions"; > localizedStrings["Disable Program"] = "Disable Program"; > localizedStrings["Disable all breakpoints (%s)"] = "Disable all breakpoints (%s)"; > localizedStrings["Disable paint flashing"] = "Disable paint flashing"; >@@ -1018,6 +1021,7 @@ localizedStrings["Unsupported property value"] = "Unsupported property value"; > localizedStrings["Untitled"] = "Untitled"; > localizedStrings["Use Default Appearance"] = "Use Default Appearance"; > localizedStrings["Use Default Media Styles"] = "Use Default Media Styles"; >+localizedStrings["Use Mock Capture Devices"] = "Use Mock Capture Devices"; > localizedStrings["Use the resource cache when loading resources"] = "Use the resource cache when loading resources"; > localizedStrings["User Agent"] = "User Agent"; > localizedStrings["User Agent Stylesheet"] = "User Agent Stylesheet"; >diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js >index 3e0e136ce76170a21b95de038168eb3c5b7f7229..647245293a35b3d90024f4164fcf2674bf3a0d41 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Main.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js >@@ -448,7 +448,7 @@ WI.contentLoaded = function() > this._inspectModeToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleInspectMode, this); > > // COMPATIBILITY (iOS 12.2): Page.overrideSetting did not exist. >- if (InspectorFrontendHost.isRemote && WI.sharedApp.debuggableType === WI.DebuggableType.Web && InspectorBackend.domains.Page && InspectorBackend.domains.Page.overrideUserAgent && InspectorBackend.domains.Page.overrideSetting) { >+ if (WI.sharedApp.debuggableType === WI.DebuggableType.Web && InspectorBackend.domains.Page && InspectorBackend.domains.Page.overrideUserAgent && InspectorBackend.domains.Page.overrideSetting) { > const deviceSettingsTooltip = WI.UIString("Device Settings"); > WI._deviceSettingsToolbarButton = new WI.ActivateButtonToolbarItem("device-settings", deviceSettingsTooltip, deviceSettingsTooltip, "Images/Device.svg"); > WI._deviceSettingsToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._handleDeviceSettingsToolbarButtonClicked, this); >@@ -2045,6 +2045,9 @@ WI._handleDeviceSettingsToolbarButtonClicked = function(event) > } > > function createCheckbox(container, label, setting) { >+ if (!setting) >+ return; >+ > let labelElement = container.appendChild(document.createElement("label")); > > let checkboxElement = labelElement.appendChild(document.createElement("input")); >@@ -2168,12 +2171,21 @@ WI._handleDeviceSettingsToolbarButtonClicked = function(event) > } > }); > >- let disableColumns = createColumns(createContainer(contentElement, WI.UIString("Disable:")), 2); >- createCheckbox(disableColumns[0], WI.UIString("Images"), PageAgent.Setting.ImagesEnabled); >- createCheckbox(disableColumns[0], WI.UIString("Styles"), PageAgent.Setting.AuthorAndUserStylesEnabled); >- createCheckbox(disableColumns[0], WI.UIString("JavaScript"), PageAgent.Setting.ScriptEnabled); >- createCheckbox(disableColumns[1], WI.UIString("Site-specific Hacks"), PageAgent.Setting.NeedsSiteSpecificQuirks); >- createCheckbox(disableColumns[1], WI.UIString("Cross-Origin Restrictions"), PageAgent.Setting.WebSecurityEnabled); >+ if (PageAgent.Setting.ImagesEnabled || PageAgent.Setting.AuthorAndUserStylesEnabled || PageAgent.Setting.ScriptEnabled || PageAgent.Setting.NeedsSiteSpecificQuirks || PageAgent.Setting.WebSecurityEnabled) { >+ let disableColumns = createColumns(createContainer(contentElement, WI.UIString("Disable:")), 2); >+ createCheckbox(disableColumns[0], WI.UIString("Images"), PageAgent.Setting.ImagesEnabled); >+ createCheckbox(disableColumns[0], WI.UIString("Styles"), PageAgent.Setting.AuthorAndUserStylesEnabled); >+ createCheckbox(disableColumns[0], WI.UIString("JavaScript"), PageAgent.Setting.ScriptEnabled); >+ createCheckbox(disableColumns[1], WI.UIString("Site-specific Hacks"), PageAgent.Setting.NeedsSiteSpecificQuirks); >+ createCheckbox(disableColumns[1], WI.UIString("Cross-Origin Restrictions"), PageAgent.Setting.WebSecurityEnabled); >+ } >+ >+ if (PageAgent.Setting.MediaCaptureRequiresSecureConnection || PageAgent.Setting.ICECandidateFilteringEnabled || PageAgent.Setting.MockCaptureDevicesEnabled) { >+ let webRTCColumns = createColumns(createContainer(contentElement, WI.UIString("%s:").format(WI.unlocalizedString("WebRTC"))), 1); >+ createCheckbox(webRTCColumns[0], WI.UIString("Allow Media Capture on Insecure Sites"), PageAgent.Setting.MediaCaptureRequiresSecureConnection); >+ createCheckbox(webRTCColumns[0], WI.UIString("Disable ICE Candidate Restrictions"), PageAgent.Setting.ICECandidateFilteringEnabled); >+ createCheckbox(webRTCColumns[0], WI.UIString("Use Mock Capture Devices"), PageAgent.Setting.MockCaptureDevicesEnabled); >+ } > > WI._deviceSettingsPopover.presentNewContentWithFrame(contentElement, calculateTargetFrame(), preferredEdges); > }; >diff --git a/Source/WebInspectorUI/UserInterface/Views/Main.css b/Source/WebInspectorUI/UserInterface/Views/Main.css >index 15a71ef104f7d4c3389626809a0bd8707a372d3a..cfbaead215f87492cdbfed2f64e1a6bf20a2939c 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/Main.css >+++ b/Source/WebInspectorUI/UserInterface/Views/Main.css >@@ -391,6 +391,10 @@ body[dir=rtl] .go-to-arrow { > padding: 8px; > } > >+.device-settings-content .container { >+ margin-top: 8px; >+} >+ > .device-settings-content .columns { > display: flex; > } >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 9b0eacaa9b7a79c21fda40dcbd6b7dcc77dae73c..6fb1f786f764499c5683613defad69477260378c 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -629,23 +629,11 @@ HTTPEquivEnabled: > defaultValue: true > webcoreName: httpEquivEnabled > >-MockCaptureDevicesEnabled: >- type: bool >- defaultValue: DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED >- webcoreBinding: DeprecatedGlobalSettings >- condition: ENABLE(MEDIA_STREAM) >- > MockCaptureDevicesPromptEnabled: > type: bool > defaultValue: true > webcoreBinding: none > >-MediaCaptureRequiresSecureConnection: >- type: bool >- defaultValue: true >- webcoreBinding: DeprecatedGlobalSettings >- condition: ENABLE(MEDIA_STREAM) >- > # FIXME: What is this for? > EnumeratingAllNetworkInterfacesEnabled: > type: bool >@@ -1551,3 +1539,15 @@ AdClickAttributionEnabled: > humanReadableDescription: "Enable Ad Click Attribution for Cross-Site Link Navigations" > webcoreBinding: RuntimeEnabledFeatures > category: internal >+ >+# Deprecated >+ >+MockCaptureDevicesEnabled: >+ type: bool >+ defaultValue: false >+ condition: ENABLE(MEDIA_STREAM) >+ >+MediaCaptureRequiresSecureConnection: >+ type: bool >+ defaultValue: true >+ condition: ENABLE(MEDIA_STREAM) >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.h b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >index 0a52167c20fa5ae0404734784a49ec91c9106ff7..ff191f14b6ae63ecbd99c4a5688c69c9d25c0a91 100644 >--- a/Source/WebKit/Shared/WebPreferencesDefaultValues.h >+++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >@@ -112,11 +112,9 @@ > #if PLATFORM(IOS_FAMILY_SIMULATOR) > #define DEFAULT_ACCELERATED_DRAWING_ENABLED false > #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING false >-#define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED true > #else > #define DEFAULT_ACCELERATED_DRAWING_ENABLED true > #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING true >-#define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED false > #endif > > #if PLATFORM(COCOA) >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index eaef8ff160fb4eb30a890e6bcf53afda6ad55017..2835ef51585de16757827c98919aa357eb95d6d9 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -3054,8 +3054,8 @@ - (void)_preferencesChanged:(WebPreferences *)preferences > #endif > > #if ENABLE(MEDIA_STREAM) >- DeprecatedGlobalSettings::setMockCaptureDevicesEnabled(false); >- DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(true); >+ settings.setMockCaptureDevicesEnabled(false); >+ settings.setMediaCaptureRequiresSecureConnection(true); > RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(false); > RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled(false); > RuntimeEnabledFeatures::sharedFeatures().setMediaRecorderEnabled(preferences.mediaRecorderEnabled);
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 193863
:
360232
|
360233
|
360234
|
360257
|
360259
|
360260
|
360267
|
360269
|
360356
|
360372
|
360428