How to set icon for pageaction in firefox android extension

I use PageActions to create address bar button in adnroid ff addon https://developer.mozilla.org/en-US/Add-ons/Firefox_for_Android/API/PageActions.jsm.

And I have icon.png in main directory of addon project. Example of my PageAction:

PageActions.add({
icon: “icon.png”,
title: “My page action”,
clickCallback: function () {
showAlertDlg(‘myaddon’, ‘action’);
}
});
But button create without icon. How correctly set icon to my pageaction?

I don’t think you can link to that main icon. Try putting a copy in the your data folder and then set icon: self.data.url('myicon.png')

Hi, I tried it, but seems it not work in bootstraped extensions. And I can’t correctly initialize this icon in install.rfd

As your addon is an sdk addon, you shouldn’t have to mess with the install.rdf

Can you link us to your code?

I found solution: -Create in main project folder skin/icon.png -Create chrome.manifest with content: content my-addon content/ skin my-addon classic/1.0 skin/ -Use icon as:

uuid = PageActions.add({
icon: “chrome://my-addon/skin/icon.png”,
title: “My page action”,
clickCallback: function () {
}
});
Problem was that I wrote icon: “chrome://skin/icon.png” without addon name “my-addon” in path