browser.downloads.onChanged.addListener Doesn't work in Firefox? - firefox-addon-webextensions

I'm having some trouble with WebExtensions in Firefox. I've got some code to track downloads, and it's working in Chrome, but not in FF.
I've boiled the code down to the minimal surface that works in Chrome but not FF:
function handleChanged(delta) {
console.log(delta);
}
chrome.downloads.onChanged.addListener(handleChanged);
Whether I use chrome.* or browser.*, the behavior remains the same: it doesn't work. I've tried executing this line:
console.log(chrome.downloads.onChanged.hasListener(handleChanged));
After adding the listener, and it does log a value of true. Oddly enough, adding an onCreated listener works just fine:
function handleCreated(delta) {
console.log(delta);
}
chrome.downloads.onCreated.addListener(handleCreated);
This yields the expected object dump in the console when a download is started. Unless I'm missing something extremely obvious, I'm inclined to think this is a bug. It is not mentioned to the incompatibilities list, and it is documented by Mozilla. The thing is, I don't see anybody else asking this question online, so I'm inclined to think a bug is unlikely and I'm messing something up.
If it helps, I'm running Firefox 51.0.1 (32-bit) on Windows 7 Enterprise x64 inside of VMWare Workstation on a Windows 7 Enterprise x64 host. I'm loading the extension using the "Load Temporary Add-on" button. It's not a problem with the core manifest or add-on itself, because three other types of listeners are working just fine. The script is running as a background script.
I appreciate any guidance. Thanks!

Related

Installing Gears in 2012

For one of the customers of my company, I have to get Gears working. To explain briefly, they have a site using the Gears local database and now want to really use localStorage (at least for browsers supporting it and still use Gears for the old ones).
To refactor the code and ensure that the HTML5 version works as the Gears version used to work (and that I do not break the existing system is also a plus). And here comes the problem: Gears is not supported anymore and seems unable to install.
My dev' machine is using OSX Snow leopard. I tried the Gears custom installer made by the authors of MailPlane (http://mailplaneapp.com/download/google_gears/) to enable gears on Safari. The installer runs without any issue and I have a "Google Gears settings" entry in Safari's menu. But the code does not work, here's the console output for the database creation code:
> google.gears.factory.create('beta.desktop')
Error
line: 2
message: "'undefined' is not a function (evaluating 'google.gears.factory.create('beta.desktop')')"
sourceId: 419639712
__proto__: Error
(this is the code I got from the customer).
In the console, when I try accessing the Gears factory, I just get a simple html object:
> google.gears.factory
<object style=​"display:​ none;​ " width=​"0" height=​"0" type=​"application/​x-googlegears"></object>​
In Gears preferencies, there's a site of sites for which I can allow Gears to run, but I can't add localhost there (I can't add anything in fact).
As I can't get Safari/Gears working, I decided to setup a WinXP virtual machine, maybe it would work here.
I was able to download the Gears installer. But this one needs file that have been removed from Google servers (at least I guess, but I don't have any firewall installed so I don't see what could block the installer when getting the files ...).
I also tried old Chrome installers (apparently Gears was shipped in Chrome 12-) but none of the installers work (they just, well, do nothing. I even tried to start them from the command line to expect a bit of output but I got nothing).
Another option would be to get a Firefox gears add-on, but they all seem to have disappeared :/
So, the question (finally): does anyone here still have to use Gears and how do you get it running on new machines ?
Cheers,
Vincent
I think The Google Gears API is no longer available.
Please see https://developers.google.com/gears/ page.
Thanks,
Jigar

GetWindow() method in White fails on Win 7, 32bit

I am trying White for the first time. I tried to run a sample test to get a window of notepad, it doesnt seem to work. Here is what I did:
//Launch the app
Application app = Application.Launch("notepad.exe");
//Get the main window after launching the app
Window win = app.GetWindow("Untitled - Notepad");
This last line throws an error as type initializer exception. When I go into the source code for White, it fails at finding the window.
When I used GetWindows() and try to get first window, it works fine.
But the same error is thrown for the child objects as well.
I have Win7, 32 bit. By build configuration is Debug|x86. I also tried the same code on Win XP, 32 bit and it worked well.
Can anyone please tell me how do I go about this.
I think I found the solution. When I tried running same code on a Win 7, 64 bit machine, it seemed to work perfectly alright.
I tried using the dependency walker and found that there is some issue with the dlls on my machine. Though I dont think I can get my system fixed just for that, I guess it might help others if they are facing this issue.

System.OutOfMemoryException and a few exceptions happen during application run, Visual Studio 2010 WPF C#

I just discovered this problem today, and I had no idea what caused this problem. My project had been developed for few months.
I have a project(solution), with several projects in there, it works well if I write and debug, by pressing F5.
The problem occur is when I press Ctrl+F5 (to skip debug mode), or run directly from double click the exe, it crashed. The errors dialogs that pop up every times are different, but OutOfMemoryException is the most frequent one.
I had checked to make sure all my projects are .Net 3.5
I put a MessageBox.Show("something") at the beginning of my main project constructor, but it never reach.
I use some registry cleaner to clean/fix my registry, scan for viruses.
I had try to read the meaning of each error and exception, but still no clue why it happen.
These are a series of screenshots if I press Ctrl + F5. (FutureGenerator is some random name I gave to my project.)
Series of screenshot if I run the app from my debug folder, FutureGenerator.exe
I suspect this is caused by framework crashed during Windows Update, but I removed those update that I performed recently, still same. The exe file works on other non development PC, but I don't want to reformat my PC or reinstall my VS, yet, because it's a painful process.
Any idea, anyone?? Million thanks.
You mention v3.5 but the very first screenshot is about v4.
Try repairing your Framework 4 and/or VS2010
I found the problem. It's actually because I added FutureGenerator.exe into Application Verifier by Microsoft. The verifier only support debugging testing.
After I removed FutureGenerator.exe from the Application Verifier, everything's ok.

OpenFileDialog crashes under Windows XP, but not Windows 7

I've got a strange problem I haven't seen before. I can open an OpenFileDialog in Windows 7 without any problems. However, when I try my app on Windows XP, calling OpenFileDialog.ShowDialog() immediately crashes the application. It just vanishes! When running from the debugger, I don't get any unhandled exceptions. If I wrap the code in a try/catch block, nothing gets caught. I have also checked all thrown exceptions in Debug -> Exceptions, but nothing pops up. I'll try some of the other suggestions in the answers below and will report back.
Does anyone know how to resolve this problem? I found a post about something similar, but it was the opposite problem. I'll try tweaking the desktop settings to see if it's related to that, but I am dubious.
EDIT -- as a sanity check, I wrote a test WPF application that displays an OpenFileDialog directly via the main window as well as another Window that can be displayed by the main window. It totally works fine under Windows XP. So now I'm really confused. I have verified that I'm not doing something stupid like trying to display the dialog from a worker thread. The OpenFileDialog displays briefly, then disappears along with the application.
EDIT -- I'm going to try to reproduce this problem on another XP computer. For now, I'll try Windows XP mode and we'll see what happens.
I got a similar error when a DLL crashes when I open a OpenFileDialog. It turned out that OpenFileDialog changed the working directory so my dll tried to write to a relative file that did not exist.
Do you see any "First Chance" exceptions in the Output? Any entries in the event log? Does the default path you're using exist on the XP machine?
Try adding a handler to the App Domain's UnhandledException
Does the same happen when you use a brand new, stock FileOpenDialog without any tweaks? What about from a brand new app which does nothing but show a file open dialog?
See Galet's post
I cannot tell you what exactly the problem is, but here's what you could do to get a clue what's really happening. I assume you're using VS2008 or 2005.
1.Switch to release mode
2.Go to Debug\Exceptions, and mark all "Thrown" exceptions, like illustrated here: http://vvcap.net/db/JbWS_tzy2IpBoI7R7amm.htp
3.Run executable in debugger, ignore the warnings from VS that there's no debug info
It does seem that there's a win32 exception thrown some time during execution, but this way or another, you will get one or more messages from debugger explaining what kind of exception happened and where. In most cases those messages make it pretty clear what exactly went wrong
EDIT: One thing I forgot to mention is that unmanaged debugging must also be turned on, such like here (when you start program directly from IDE) or here (when you attach to running process)
link|edit|flag edited Apr 12 '09 at 22:32
answered Apr 10 '09 at 19:01
galets
1,2201924

Flash - Why doesn't my SharedObject get saved on disk when closing IE?

I have a Flash application that uses SharedObject to save and read some data locally. As it is said everywhere Flash saves the data from the shared object to disk when the application is closed. And indeed it does when I test it with the stand-alone Flash Player or all of these browsers: Firefox, Opera, Safari, Chrome, Flock... But it doesn't work when I use IE (I've tried IE6 and IE7).
Does anyone know anything about this issue? Why might it be happening... and how to get it to work?
Are you using MultipleIEs or standalone versions of the IE browsers? I've had issues with that as it seems they don't work properly when installed together.
The best way to be sure is testing your application on someone else's computer with only one version of IE installed.
EDIT: Check out the hints below:
It seems that if you install things in a special order evrything seems to work better.
Install/upgrade to IE8
Install standalone IE7
Install MultipleIEs (IE6 and below)
Also check the IE Collection (finalbuilds.edskes.net/iecollection.htm) tool instead of MultipleIEs for better results.

Resources