IRC Log Viewer » #firebreath » 2013-06-26

IRC Nick Time (GMT-7) Message
taxilian 00:06 niftylettuce: you can't do that using a plugin
wait... you're talking about in the browser or on the desktop?
wavey 01:06 niftylettuce: In principle you *could* (on windows) but I don't think it's a good idea. You could create a CppShellExtContextMenuHandler (some googling revealed this : http://code.msdn.microsoft.com/windowsdesktop/CppShellExtContextMenuHandl-410a709a )
But if the user uninstalls the plugin, you will leave junk in the registry
diorcety 02:06 Hum .. i notice a awkward issue.
We can't access to dom properties/functions
for example
hasClass
oups
classList
className
diorcety 02:06 only on NPAPI
on Activex it works
reichi 02:06 on your plugin?
do you want to call pluginObjectInstance.className ?
diorcety 02:06 indeed
not exactly
i want check with jquery obj.hasClass
reichi 02:06 well
diorcety 02:06 it is equivalent
reichi 02:06 a common npapi issue
diorcety 02:06 on IE
it works
reichi 02:06 yes
ie is not npapi
diorcety 02:06 yes :)
reichi 02:06 and work a little different
works
diorcety 02:06 i know
reichi 02:06 well
npapi has setReserved
which basically sets method that are "there" but known to the plugin
the point is that the browser will call "HasMethod"
oder "HasProperty"
which will return false
and therefore the browser thinks that method or attribute is not there
diorcety 02:06 okay
i need to call setReserved on className and classList ?
reichi 02:06 i have written a "restoreReserved" method
https://gist.github.com/sreichholf/012b4877490d8a09e6f5
as i actually had the exact same need
but more generic
this will basically set everything available via Element.prototype reserved
diorcety 02:06 reichi: Thanks :)
reichi 02:06 but be careful
it could break other things
;)
diorcety 02:06 i will put only my 2 names :)
it's safer
reichi 02:06 yes
ans long as your under control of the plugin and the websites using it
that's definitely the way to go
diorcety 03:06 reichi: Many thanks :)
reichi 03:06 you're welcome
wavey 03:06 guys, if I want to submit a fix, on which branch should I make the pull request?
on the master?
forget it, I didn't read the "Submitting a Patch" :P
wavey 03:06 Some new features pushed :D
Progress events & custom data receiving function on SimpleStreams ;)
diorcety 04:06 wavey: do you provide a way to get received bytes?
wavey 04:06 yup
setChunkCallback()
diorcety 04:06 nice :)
wavey 04:06 if you want per-chunk
or setCallback()
to receive the entire buffer when completed
(already implemented)
diorcety 04:06 i talk about size_t getReceived() {return received;}
actually it's private
wavey 04:06 ah, I use Content-Length
(when provided)
and I use it to fire the progressCallback
so you can setProgressCallback()
it calls a function( current, total )
diorcety 04:06 received is set to content-length (when provided)
wavey 04:06 with total=0 if no Content-Length provided
damn :P
didn't see this XD
I did the same thing on the SimpleStreamHelper
diorcety 04:06 sorry
i said a wrong stuff
sorry
wavey 04:06 That's what I added : https://github.com/firebreath/FireBreath/pull/110/files
diorcety 04:06 wavey: getStream()->getLength();
return that
not received
wavey 04:06 That's the current chunk size
not the entire file size :/
There is no reliable way to get the total file size
the server must add a Content-Length header
diorcety 04:06 :|
Returns the length of the stream in bytes (if server gives info like content-length).
in the brief of virtual size_t getLength() const of BrowserStream
wavey 04:06 damn
you are right
I was refering to the StreamDataArrivedEvent
XD
diorcety 04:06 ^^
wavey 04:06 Ok, I should add a patch to my patch
diorcety 04:06 i'm not sure
but the doc say that
wavey 04:06 we need taxilian for this :P
On the examples, they were using that, indeed
wavey 04:06 are there any arithmetic issues when you cast a double to size_t like this? : size_t v = (size_t) doubleVal; ?
(assuming size_t is an unsigned integer)
diorcety 04:06 not sure
but it's better to use static_cast<>
reichi 04:06 welll
size_t is an unsigned int
or well
it depends
diorcety 04:06 ^^
reichi 04:06 on 64 bit it's a long unsigned int
on 32 i think its long long unsigned int
diorcety 04:06 static_cast<size_t>(doubleVal)
thoys 05:06 Hey guys, was wondering if theres a good way to silently update the plugin
talking about (windows)
wavey 05:06 (thanks guys for before)
thoys: For firefox you can include an update channel in your plugin
for chrome you have to add it on chrome store
for IE I am not aware of any solution :/
thoys 05:06 most of our customers have Chrome and IE
and i do not want to add it to some public store
its just used internally
wavey 05:06 The problem is that chrome will not allow automatic installation of a plugin that is not on stire :/
*store
Now I am not sure if it's going to update it if it's already installed ...
thoys 05:06 so i should make a program in the background on windows
updater service?
xD
wavey 05:06 I think that you can make auto-updatable windows installer packages
thoys 05:06 it needs to restart the browsers tho
hmm ClickOnce sounds dangerous :D
wavey 05:06 but it's for .NET only, no?
thoys 06:06 ye
2.0
pretty common, but still we have some old windows xp machines with old IE browsers and probably no .net
lol
wavey 06:06 anybody knows how to redirect the stdout of plugin-host (firefox, windows) on a console? :P
thoys 06:06 dont u have a console inside ff?
wavey 06:06 yeah I was doing some debigging on stderr :P
it worked on linux, but I think I will move to FB logging
thoys 06:06 not sure if u can point the stdout to FB logging
then it would be easy to convert xD
wavey 06:06 I planned for it, so I used an overridable macro for logging :P
I found OutputDebugString() on windows
I guess it's like a broadcast on the windows api :P
lol.. it works XD
thoys 06:06 cool
thanks for the tip
wavey 06:06 It needs this: http://technet.microsoft.com/en-us/sysinternals/bb896647
to receive the messages
thoys 06:06 wow
thats easier than attaching all time
wavey 06:06 yup XD
Actually log4cpp does it
so if you are using fireBreath logging, it's automatic ;)
thoys 06:06 and ur browser auto starts on F5?
wavey 06:06 .. but I didnt :P
thoys 06:06 xD
wavey 06:06 hehe
I auto-attach on F5
:P
so I need the browser open
thoys 06:06 hmm int _tmain(int argc, CHAR* argv[]){ OutputDebugString(L"HELLOW OR DL");return 0; } //doesnt do anything for me
wavey 06:06 Do you have the DebugView open?
And are you building in debug configuration?
thoys 06:06 double yes
wavey 06:06 tha'ts weird :/
rostig_ 07:06 Has anybody attempted to set text for <title> tag from plugin code?
I have strange problem: here is my code
CString origStr("Текст по русски, 123, English text");
std::string titleTxt = CT2A(titletext);
getHost()->getDOMDocument()->getElementsByTagName(std::string("title"))[0]->setInnerHTML( titleTxt );
In IE it works. In NP browsers it fails, e.x. in firefox title is not set completely, in chrome & opera russian part is replaced by �
taxilian 08:06 rostig_: instead of using a CString, use a std::wstring
and make sure your file is the right encoding
rostig_: most likely the file is not the correct encoding, but all you should have to do is something like this:
std::wstring titleTxt("мой русский текст"); getHost()->getDOMDocument()->getElementsByTagName("title")[0]->setInnerHTML(titleTxt);
as long as your file is utf8 encoded that should work
thoys 08:06 did u just write "my title text" in russian ? xD
taxilian 08:06 I might have done =]\
it is possible, just possible, that I happen to be fluent in Russian
randomly
thoys 08:06 hehe
taxilian 08:06 actually, you might just be able to do getHost()->getDOMDocument()->setProperty("title", "мой русский текст");
rostig_: or at worst getHost()->getDOMDocument()->setProperty("title", L"мой русский текст");
thoys 08:06 or getHost()->getDOMDocument()->setProperty("title", TEXT("мой русский текст"));
lol
taxilian 08:06 yeah, that might work as well, but in this case you actually probably want it to always be one or the other. thing is, FireBreath will automatically convert it between wide and standard string, with standard being utf8 encoded
thoys 08:06 are there any plans for an autoupdater class btw?
xD
spares me to use teamviewer 135 times
per update
taxilian 08:06 I had some plans at one time, but lately no
autoupdater would be useful to a lot of people but it's not something that to me justifies the time and troubleshooting
it's not an easy problem to solve
thoys 08:06 Wish I could help out, but have no idea how to organize it lol
js-php: if(plugin().version < <?=$strCurrentVersion?>){ plugin().performUpdate(); }
maybe to install it in AppData, but some people want to have their plugins available for all users
*might want to
wavey 08:06 taxilian: I managed to solve the BrowserStream isses
You have a new pull request ;)
thoys 08:06 you made a progress indicator?
wavey 08:06 yup
thoys 08:06 cool
wavey 08:06 plus a custom data saving function
(Because I wanted to download to file)
(large file :P)
taxilian 08:06 wavey: I am looking at hte pull request now
have you run the FBTestPlugin tests?
and what platforms have you built it on?
wavey 08:06 I am building on all platforms
and I rebuilt everything from sources
so I guess the tests were run, right?
Windows32, Linux64, Linux32 (ubuntu 12.04), OSX 10.6.8
taxilian 08:06 no; the FBTestPlugin tests you have to build FBTestPlugin, install it, and then open examples/FBTestPlugin/test.html
wavey 08:06 it will take some time
however my plugin runs properly on all platforms
taxilian 08:06 if you can run the tests and they all look good, I'll be happy to accept the pull request
wavey 08:06 yup, now it runs on linux
I just need to re-build the entire stack
wavey 09:06 taxilian: Using the latest master branch that I forked from, the only test that doesn't seem to complete is "Dialog callback test..."
(Linux 64)
now testing on linux32
taxilian 09:06 .. that's weird. shouldn't be related to what you're doing, though
note that that one takes like 5 seconds to complete
wavey 09:06 should I type something in particular on the dialog that appears?
taxilian 09:06 no
just hit okay
wavey 09:06 nope, that's still there :/
only one js error: c.currCSS is not a function ( from jquery-ui.min.js)
the same (incompleted test) on linux32
18.0.2 firefox
hmmm...
quite old XD
taxilian 09:06 odd.. very odd
rostig_ 09:06 taxilian: getHost()->getDOMDocument()->setProperty("title", L"xyz"); - this was most elegant solution, thank you
taxilian 09:06 I'm really not sure you'll need the L; if your file is utf8 it will probably work
рад помогать =)
rostig_ 09:06 Instead of L"..." I pasted my CString variable and it worked. I faced the problem converting CString values (from legacy mfc project) to std::string/wstring/FBvariant. But it turned out to be simple. Ничего себе, сколько здесь наших)
wavey 09:06 taxilian: OSX passes the test too, but again the "Dialog callback test" is pending...
taxilian 09:06 бывает русскйе, а не часто — я сам американец, просто жил в руссии на два года несколько лет назадь
wavey 10:06 taxilian: tests passed also on windows
(again the same thing with the dialog)
taxilian 10:06 ok
tonikitoo 15:06 taxilian, ping. would you have some moment to talk about http://stackoverflow.com/questions/10578631/how-can-i-pass-binary-stream-read-from-a-jpg-file-about-1m-from-firefox-plu ?
taxilian 15:06 sure, what is your question?
tonikitoo 15:06 I am interested in experimenting with the embedded webserver approach.
and I am wondering if you developed your own webserver, or did you base it on an existing one?
taxilian 15:06 it's in the codebase
HTTPService
tonikitoo 15:06 ah!
I will have a look, thanks.
taxilian 15:06 note that this approach can have some interesting problems if you're using https
because you can't have the embedded webserver be https
tonikitoo 15:06 Right. I saw you listing it as a disadvantage.
taxilian 15:06 been awhile since I wrote that =]
taxilian 15:06 ahh; there was a breaking change in boost when it changed from filesystem v2 to v3
I think it just needs to be std::wstring fn = path_to_investigate.filename().string()
tonikitoo 15:06 I can give it a try
from looking at the header , it returns a string, where a wstring would be needed.
yes, it just failed to build. Trying some more..
taxilian 15:06 just change it to expect a string, then
shouldn't be a big issue
you'll just have to play with it a bit
tonikitoo 15:06 thanks again
taxilian 15:06 FB::utf8_to_wstring and FB::wstring_to_utf8 might be helpful
michael-fig 21:06 Does anybody out there know why my X11 GDK_EXPOSE events stop being produced by InvalidateWindow after I mouse over the plugin window?