IRC Log Viewer » #firebreath » 2015-04-28

IRC Nick Time (GMT-7) Message
walter_ 07:04 Hi Taxilian.... I tried your fix - all works fine now.... Thanks
I also pushed that cmake bugfix with include dir I mentioned - details in commit message
rangerz__ 07:04 Does anybody know how to build echoTestPlugin example of branch: rafactor´╝č
walter_ 07:04 the way I do it:
the way I do it:
Make a root folder, and then put firebreath files into "firebreath" folder, then create yourself "fbprojects" folder - and copy example projects into "fbprojects"
Then in that root folder type: firebreath\prep2013.cmd fbprojects\FBTestPlugin fbbuild
it will create fbbuild with VS files
I do it this way - not to change "firebreath" files structure - in case of update... etc...
In addition - my root folder contains 3 folders: fbbuild, fbprojects, firebreath
taxilian 08:04 rangerz__ I was just responding to your email
rangerz__ I was just responding to your email
and telling you to come here =]
and telling you to come here =]
walter_ 09:04 Hi taxilian
taxilian 09:04 'morning
walter_ 09:04 your fix, did the job... it works now ;)
thx
are you here?
taxilian 09:04 yes
but in a meeting
sorry
saying my nick here will get my attention a bit faster
saying my nick here will get my attention a bit faster
walter_ 09:04 I have 1 more question for you.... Actually just looking for your recommendation on this
In my project - I want to make sure NPAPI/ActiveX/Native Mess is called only from certain location, like only from certain extension - or certain URL - this need to be done in C++ - not to allow unauthorized use
The way I was doing it so far - is that I implemented it in --> FB::JSAPIPtr <project>::createJSAPI() { }
I was simply getting the URL that is trying to load the plugin --> std::string url = m_host->getDOMWindow()->getLocation();
and then based on the URL - I was loading Authorized or Unauthorized API class
so there is no error if someone tries to load it - it's just that it's missing important functions
so there is no error if someone tries to load it - it's just that it's missing important functions
taxilian
The problem is that now std::string url = m_host->getDOMWindow()->getLocation() ---> It returns a promise, and I can't use it this way - also when I try to - it crashes.... I guess firewyrm transport protocol is not ready in this step yet...
could you advise sth in this use-case ?
taxilian 10:04 sorry, back again
sorry, back again
looking
getlocation will always be async; there isn't anything I can do about that
however, it certainly shouldn't crash =]
what is the crash?
walter_ ^
walter_ 10:04 I'm here, 1sec
https://gist.github.com/wojwal/c00a3d9b12a749c0725e
this is what I tried in FBTestPlugin createJSAPI
it crashed on that promise
taxilian 10:04 hmm; what was the crash?
walter_ 10:04 Unhandled exception at 0x0F260FF2 (npFBTestPlugin.dll) in FireWyrmNativeMessageHost.exe: 0xC0000005: Access violation reading location 0x00000000.
taxilian 10:04 attach a debugger and find out where that actually is
attach a debugger and find out where that actually is
I have a hunch, though
I have a hunch, though
walter_ 10:04 well - I attached debugger.... top of the callstack is just saying:
> npFBTestPlugin.dll!FBTestPlugin::createJSAPI() Line 71 C++
which is just m_host->getDOMWindow()->getLocation().then<FB::variant>([](std::string url) -> FB::variant
taxilian 10:04 I'm wondering if getDOMWindow() is returning a nullptr
I'm wondering if getDOMWindow() is returning a nullptr
walter_ 10:04 I wasn't that sure if this is a bug at all....
taxilian 10:04 it could be domwindow is not yet available at this point
walter_ 10:04 I mean, can this:
return std::make_shared<FBTestPluginAPI>(std::dynamic_pointer_cast<FBTestPlugin>(shared_from_this()), m_host);
can be changed into promise?
let me check that domwindow...
let me check that domwindow...
taxilian 10:04 I think it would be better to wait to create the jsapi and return that we're ready until after we've got the domwindow
to change that call to a promise would break a *lot* of things... could be done, might even make sense, but I'd rather not unless we need to
walter_ 10:04 yeah, you were right
FB::DOM::WindowPtr window = m_host->getDOMWindow();
window is empty
well - I can solve it differently.... This was the nicest way in 1.7
well - I can solve it differently.... This was the nicest way in 1.7
any recommendations from your point of view?
taxilian 10:04 give me a minute; I have a few thoughts
we're doing sprint planning right now so my attention is only half here
darn boss thinks I should do my job for some reason =]
darn boss thinks I should do my job for some reason =]
walter_ 10:04 hehe ;)
taxilian 10:04 so here is what I'd do:
at least as a quick fix
add a WyrmBrowserHost::getReadyPromise() to return m_onReady
then you can use m_onReady.done(....) and inside that callback the window and such will be available
walter_ 11:04 taxilian
taxilian 11:04 hello