I would try the approach outlined here, it might be because the domains
don't match although thats a silly restriction.
http://softwareas.com/dynamic-favicons
http://ajaxian.com/archives/favicon-access-via-javascript

<http://softwareas.com/dynamic-favicons>The approach taken seems similar, I
would try their approach first and see if you can get it working with remote
URLs, then you can probably figure out what you're doing wrong if its
possible to get it working.

I was looking for something like window.favicon property but I can't seem to
find anything like that.

On Thu, Jan 21, 2010 at 7:56 AM, jure <[email protected]> wrote:

> hi,
>
> i want dynamically replace Castle Age's (facebook game) favicon, but
> strangely favicon doesn't change!
>
> where am i wrong?? here is the code:
>
> // ==UserScript==
> // @name           FB Castle Age
> // @namespace      http://apps.facebook.com/castle_age/
> // @include        http://apps.facebook.com/castle_age/*
> // ==/UserScript==
> var head=document.getElementsByTagName("head")[0];
>
> var ico={
>        e:document.createElement("link")
> }
> ico.e.id="ico_e";ico.e.rel="icon";ico.e.type="image/png";
> ico.e.href="http://www.rw-designer.com/icon-image/273-16x16x32.png";;
>
> var getTimers=function(){
>        // energy
>        var t=document.getElementById
> ("app46755028429_energy_time_value").innerHTML;
>        var M=document.getElementById
> ("app46755028429_st_2_2").getElementsByTagName("span")[1].innerHTML;
>        var c=document.getElementById
> ("app46755028429_energy_current_value").innerHTML;
>        document.title=t+" "+c+"/"+M;
>
>        var links=document.getElementsByTagName("link");
>        for(var i=0;i<links.length;i++){
>                var link=links[i];
>                if(link.rel=="shortcut icon"||link.rel=="icon"){
>                        head.removeChild(link);
>                }
>        }
>
>        head.appendChild(ico.e);
>        setTimeout(getTimers,1000);
> }
> getTimers();
>
> --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<greasemonkey-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=en.
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" 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/greasemonkey-users?hl=en.

Reply via email to