WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
51485
Web Inspector: support overriding user agent strings
https://bugs.webkit.org/show_bug.cgi?id=51485
Summary
Web Inspector: support overriding user agent strings
Andrey Kosyakov
Reported
2010-12-22 11:34:56 PST
This patch only covers back-end functionality and an extension API. Note we expose an ability to override user agent to extensions via webInspector.inspectedWindow.reload() to avoid possible conflicts between different extensions trying to override user agent (or rather make these conflicts more explicit). There will be a separate issue for exposing user agent selection in front-end UI.
Attachments
patch
(8.64 KB, patch)
2010-12-22 11:43 PST
,
Andrey Kosyakov
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andrey Kosyakov
Comment 1
2010-12-22 11:43:01 PST
Created
attachment 77243
[details]
patch
Yury Semikhatsky
Comment 2
2010-12-23 05:39:33 PST
Comment on
attachment 77243
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=77243&action=review
> WebCore/loader/FrameLoader.cpp:2532 > + String userAgentOverride = page->inspectorController()->userAgentOverride();
You should use InspectorInstrumentation to access inspector code instead of calling IC directly.
Pavel Feldman
Comment 3
2010-12-23 05:47:30 PST
> > You should use InspectorInstrumentation to access inspector code instead of calling IC directly.
I disagree - inspectorInstrumentation interface is only used for _instrumentation_. Until InspectorController is removed from the page, we are free to use it.
Yury Semikhatsky
Comment 4
2010-12-23 05:52:36 PST
(In reply to
comment #3
)
> > > > You should use InspectorInstrumentation to access inspector code instead of calling IC directly. > > I disagree - inspectorInstrumentation interface is only used for _instrumentation_. Until InspectorController is removed from the page, we are free to use it.
IMO it's a good example of inspector instrumentation and if we have decided to eventually leave InspectorInstrumentation as the only interface to the inspector component we shouldn't add new direct calls to InspectorController, otherwise I don't see what's the point in having additional intermediate layer(InspectorInstrumentation) which does part of IC work in some cases.
Pavel Feldman
Comment 5
2010-12-23 05:55:31 PST
> > IMO it's a good example of inspector instrumentation and if we have decided to eventually leave InspectorInstrumentation as the only interface to the inspector component we shouldn't add new direct calls to InspectorController, otherwise I don't see what's the point in having additional intermediate layer(InspectorInstrumentation) which does part of IC work in some cases.
Yes and no: we should have InspectorControllerForWebCore insterface. It is not clear whether it should be InspectorInstrumentation (which currently used only for instrumentation). My point is that unless inspector contorller is hidden as you suggest, I think it is a better place for overriding the user agent. InspectorInstrumentation is semi-generated as you remember.
WebKit Review Bot
Comment 6
2011-02-04 08:28:04 PST
http://trac.webkit.org/changeset/77620
might have broken GTK Linux 64-bit Debug
Ilya Tikhonovsky
Comment 7
2011-06-18 00:24:43 PDT
Comment on
attachment 77243
[details]
patch was landed as
r77620
Steve Block
Comment 8
2011-08-01 04:01:44 PDT
Hi Andrey, this might be a stupid question, but is there a reason that you didn't update FrameLoader::loadResourceSynchronously() to respect this new User-Agent override?
Andrey Kosyakov
Comment 9
2011-08-01 10:19:02 PDT
(In reply to
comment #8
)
> Hi Andrey, this might be a stupid question, but is there a reason that you didn't update FrameLoader::loadResourceSynchronously() to respect this new User-Agent override?
The override should also work in case of loadResourceSynchronously() -- the next line after a call to initialRequest.setHTTPUserAgen() is a call to addExtraFieldsToSubresourceRequest(), which should set the agent. Actually, it looks like the former line is redundant, I'm looking to remove this. Thanks for bringing this up, though -- I went to add a test for synchronous requests, and it turned out that due to a sad omission while manually landing the change we missed to land the test, and as a result the extension support for webInspector.inspectedWindow.reload() was broken by a subsequent change. Raised
bug 65476
for that.
Steve Block
Comment 10
2011-08-01 10:24:44 PDT
> The override should also work in case of loadResourceSynchronously()
Makes sense. Thanks for replying!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug