We need a way to retrieve the custom user agent from a WKPage.
Created attachment 71924 [details] [PATCH] Fix
Comment on attachment 71924 [details] [PATCH] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=71924&action=review > WebKit2/UIProcess/API/C/WKPage.cpp:158 > +WKStringRef WKPageGetCustomUserAgent(WKPageRef pageRef) > +{ > + return toCopiedAPI(toImpl(pageRef)->customUserAgent()); > +} If you are using toCopiedAPI then this function needs Copy in its name.
(In reply to comment #2) > (From update of attachment 71924 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=71924&action=review > > > WebKit2/UIProcess/API/C/WKPage.cpp:158 > > +WKStringRef WKPageGetCustomUserAgent(WKPageRef pageRef) > > +{ > > + return toCopiedAPI(toImpl(pageRef)->customUserAgent()); > > +} > > If you are using toCopiedAPI then this function needs Copy in its name. Should this be using toCopiedAPI or just toAPI? I see functions that return a WKStringRef on WKPage that use both toCopiedAPI and toAPI.
Created attachment 71929 [details] [PATCH] Fix - rename to WKPageCopyCustomUserAgent
Comment on attachment 71929 [details] [PATCH] Fix - rename to WKPageCopyCustomUserAgent View in context: https://bugs.webkit.org/attachment.cgi?id=71929&action=review > WebKit2/UIProcess/WebPageProxy.cpp:462 > + if (m_customUserAgent == userAgent) > + return; This code distinguishes a null string from an empty string. I’m not sure that’s intentional.
Landed in r70561.