SetCustomUserAgent in PNaCl Plugin Resulting in CORS Error

56 views
Skip to first unread message

Ethan

unread,
Oct 20, 2014, 11:35:26 AM10/20/14
to native-cli...@googlegroups.com
I have a PNaCl plugin, and when I use the pp::URLRequestInfo::SetCustomUserAgent method, I get the following error in the Chrome Console:

PPB_URLLoader.Open: The URL you're requesting is  on a different security origin than your plugin. To request  cross-origin resources, see  PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS. 

I've called SetAllowCrossOriginRequests(true); on my URLRequestInfo object.
I think my manifest.json is setup correctly, do I need another entry in there? Do I need a trusted plugin that has been signed and posted to the chrome store?

Ben Smith

unread,
Oct 20, 2014, 1:13:53 PM10/20/14
to native-cli...@googlegroups.com
Hi Ethan,

According to the documentation here, SetCustomUserAgent is only allowed on trusted URL loaders. Trusted here means running as a trusted pepper plugin.
Native Client always runs as an untrusted pepper plugin, so this feature will not be available.

-Ben

chetan kumar

unread,
Jul 20, 2016, 3:27:07 AM7/20/16
to Native-Client-Discuss
Hi, 

i am trying something very similar with Native Client, is there any other way to set UserAgent?, i too tried calling pp::URLRequestInfo::SetCustomUserAgent method, but haven't been successfull.

thanks
best regards
Chetan
Reply all
Reply to author
Forward
0 new messages