Hello,
In my extension I implemented changing browser button icon depend on some parameters. To change icon I send message to background and successfully handle it. Parameters satisfy the conditions and icon should be changed, and it is changed, but not in Firefox. In IE and Chrome this works fine. Could you advise what is wrong with my code? Why icon is not changed?
My extension ID is 33339.
Thanks.
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
-
Hello Alexandr,
I understand that you are having an issue with button images in FF. Usually, this works without problems however, I cannot fully test your extension as I don't have a valid login for your site.
However, I tested FF button images using the following code and your images and the images changed as expected. Hence I must conclude that there is an error in the logic you are using in your setLogo function. Try adding some console messages to debug the function.
background.js:appAPI.ready(function() {
var counter = 0;
function setLogo() {
console.log('setLogo::counter%3: ' + counter%3);
switch (counter%3) {
case 0:
appAPI.browserAction.setResourceIcon('images/logo-no-credentials.png');
break;
case 1:
appAPI.browserAction.setResourceIcon('images/logo.png');
break;
case 2:
appAPI.browserAction.setResourceIcon('images/logo-off.png');
break;
}
counter++;
}
setInterval(function() {
setLogo();
}, 3 * 1000);
}); -
-
Hello Shlomo,
I changed my code a bit, but I still see the issue. I added logging to functions and I see that appAPI.browserAction.setResourceIcon('images/logo-off.png'); is called.
To reproduce the issue follow this steps:
1) Open google.com and perform a search with any word. Our results panel with error message will appear.
2) Click on "Close" (X) button and select "Hide and disable" option. The pannel will be closed and icon should change.
3) Open pop-up and set "Show search results..." checkbox and click "Save", choose "Yes" in warning box. Icon should be green now and panel appears again.
4) Repeat step 2) and 3) and you will see that icon won't change. -
-
-
-
Hello Shlomo,
I modified my callback code and I just set yellow icon there. The code is pretty simple now and I don't see any issue there. I see my message I log from callback function, but then I see the error about dead object. -
-
Hello Alexandr,
Other than an error caused by the following code, the button is changing as expected once the error is fixed:console.log(searchEnabled.toString());
The error is due to the fact that when you first start the extension, searchEnabled is null and hence console.log fails. Try replacing it with the following code and it the extension button works:console.log('searchEnabled:: ' + (searchEnabled === null) ? 'null' : searchEnabled.toString()); -
-
Hello Shlomo,
Even after I removed that erroneous line I still see the same (dead object) error in the console. Also I see in the console thatappAPI.browserAction.setResourceIconfunction should be called. Is there any way to see if it really called?
Thank you a lot for helping me. -
-
Hello Alexandr,
My pleasure to help as always :-)
However, since I am not experiencing these issues, please can you provide the steps for reproducing them.
If it's the same as the ones above, since it works for me perhaps you can provide a video showing what happens at your end. -
-
-
-
-
-
Hello Alexandr,
What versions and languages of windows and the browser are you using?
Also, can you try uninstalling, clearing your browser cache, and then reinstalling from our site (http://crossrider.com/download/33339) -
-
Hello Shlomo,
I tried to reinstall extension as you advised, but no success.
I am using FF 22.0 (english) on Windows 7 Professional (russian). -
-
Hello Alexandr,
Would it be possible to arrange a TeamViewer session with you? If so, please send the credentials to support@crossrider.com along with convenient times so that we can schedule a mutually convenient slot for debugging. -
-
I have also just very recently started experiencing this problem. I am changing the toolbar button using the following function in background.js:
function set_icon(state) {
try {
if (state === true) {
appAPI.browserAction.setResourceIcon('icon-ext-on.png');
} else {
appAPI.browserAction.setResourceIcon('icon-ext-off.png');
}
} catch (e) {
console.log("set_icon exception", e);
}
}
It's been working fine for a long time now, in Chrome, IE, and Firefox. Recently however (just noticing this today), it's failing occasionally in Firefox. The exception thrown is:
Again this is only in firefox. -
-
Hello Alexandr (and Bryan),
We released a fix for this today.
Alexander, I have rebuilt you FF extension (XPI) and it should take effect within 6 hours for existing installation or you can uninstall, clear cache, and reinstall the extension.
Bryan, if you send me your extension ids, I will rebuild you extension XPI files so that they use the latest framework. -
-
Actually -- I am developing in local debug mode (on Firefox), and observing the problem. Should that matter?
In any case our extension id is 26940. Thank you. -
-
Hello Bryan,
I rebuilt your FF extension XPI. Uninstall the extension, clear the cache, and reinstall the extension.
To the best of my knowledge, working in Debug Mode shouldn't make a difference. -
-
Having some weird other behavior in Firefox now... I am using the browser button with a popup (popup.html), and it's as if popup.html's crossriderMain() function is only being called the first time I bring up the popup. And additional times after that, it's like the page content is cached with no JS being called. Still investigating.
However -- the toolbar button is now changing properly. -
-
Hello Bryan,
I'm pleased to hear that the button is now changing properly.
We are not aware of any issues with the popup, so if the problem persists, please can you report it in a new ticket. -
-
Hello Shlomo,
Today I reinstalled the extension and icon is changing as expected. Thank you!
But I also noticed that crossriderMain() function is called only once. -
-
Hello Alexandr,
Thank you for bringing this to our attention. We are now aware of the problem, but it's not a simple fix and the dev team will work to resolve it in the coming weeks.
For the information about the release of this fix, I recommend that you monitor our changelog and/or changelog RSS feed. -
Loading Profile...




EMPLOYEE

