Perhaps try javascript:window.location. We have a test for this in npapi_uitest.cc: GetURL, and it uses window.location successfully.
On Mon, Jun 8, 2009 at 1:29 PM, vijay <tec...@gmail.com> wrote: > > Hmm... I'm not exactly sure how Flash works (are there any pointers > to this or do you figure this just by debugging Flash with Chrome?) > but here's the specific problem I'm running into. > > We used to use NPN_GetURL with "javascript:document.location" as the > URL. In the current implementation, after this script is executed in > WebPluginImpl::ExecuteScript (in src/webkit/glue/webplugin_impl.cc), > its checking the result value: > > WebCore::ScriptValue result = > frame()->loader()->executeScript(script_str, popups_allowed); > WebCore::String script_result; > std::wstring wresult; > bool succ = false; > if (result.getString(script_result)) { > succ = true; > wresult = webkit_glue::StringToStdWString(script_result); > } > > For the above javascript I'm using, the result is false and I'm not > sure why. Because of that, eventually in the > PluginInstance::SendJavaScriptStream, no stream is being created at > all. As I mentioned before this used to work with Chrome 1.x. I'm not > sure why the javascript document.location does not correctly result in > a string. I probably need to dig in more. Does this exact sequence > work correctly for you? > > Thanks for all your time btw! > Vijay > > On Jun 8, 11:15 am, John Abd-El-Malek <j...@chromium.org> wrote: > > Are you sure this is broken? Flash uses this so if it was broken, we > would > > have seen lots of sites fail. > > On a debug build, I can see this working fine using about:ipc. > > > > NPN_GetProperty is called on "location" > > and the returned object is NPN_Invoke'd to call "toString" > > > > On Mon, Jun 8, 2009 at 1:38 AM, vijay <tec...@gmail.com> wrote: > > > > > Yeah. Here is what worked for us in the past: we issue a NPN_GetURL > > > with "javascript:document.location" and the browser simply delivered > > > the location via the standard NPP_NewStream, NPP_Write, etc. This > > > works perfectly with mozilla/firefox. It also used to work the same > > > exact way in Chrome 1.x so our code worked without any problems. > > > However, with Chrome 2.0 (and the webkit underneath it), there were > > > some changes and the javascript "results" are not being delivered via > > > streams any more. Chrome/webkit is simply executing the javascript and > > > ignoring the results. I can't say I agree with the rationale behind > > > the change but it seems to have killed about the simplest way to get > > > the document location :) > > > > > On Jun 7, 11:29 pm, Adam Barth <aba...@chromium.org> wrote: > > > > This turns out to be very trick to do securely. I recommend studying > > > > how Flash does this and doing *precisely* the same thing. > > > > > > Adam > > > > > > On Sun, Jun 7, 2009 at 10:57 PM, vijay<tec...@gmail.com> wrote: > > > > > > > Preferably a browser-independent way would be great. > > > > > > > Thanks in advance, > > > > > Vijay > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---