I was thinking something like the following (untested) code:
background.html
==================
<html>
<script>
var frame = null;
function setIcon(path) {
if (frame) frame.parentNode.removeChild(frame);
frame = document.createElement("iframe");
frame.src = "iframe.html#" + path;
document.body.appendChild(frame);
}
</script>
</html>
iframe.html
==============
<script>
var path = location.hash.substring(1);
chrome.browserAction.setIcon(path);
</script>
HTH,
- a
On Sat, Oct 24, 2009 at 3:14 AM, Anders Sahlin <[email protected]> wrote:
>
> Hi Aaron,
>
> thanks for your response. Could you please guide me in the correct way
> of doing this work-around? I've done a couple of tries but with no
> progress.
> When is the next dev release, sometime next week?
>
> Anders
>
> On Oct 23, 6:11 pm, Aaron Boodman <[email protected]> wrote:
>> There was a bug in this API call that caused this that I recently fixed.
>>
>> You could perhaps workaround the problem until the next dev release by
>> using a hidden iframe. The bug makes it so that only one call to
>> setIcon() works per-frame. If you call setIcon() inside a frame, then
>> reload that frame, you will be able to call it again.
>>
>> Thanks for your patience,
>>
>> - a
>>
>>
>>
>> On Fri, Oct 23, 2009 at 8:03 AM, Anders Sahlin <[email protected]> wrote:
>>
>> > I've discovered this exception that occurs when I try to change the
>> > icon:
>>
>> > chrome/ExtensionProcessBindings:369 - Uncaught TypeError: Cannot read
>> > property 'width' of undefined
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---