/    Sign up×
Community /Pin to ProfileBookmark

firefox sidepanel help…

Need some help guys. I just d/led Firefox and actually like it very much. So I’ve fixed 98% of the codeing on one of my sites to be compatible with FF. Now the problem, the add to favorites link. I pulled the important bits out for you to see. The following works in IE:

[CODE]<a href onClick=”window.external.AddFavorite(‘http://www.urlofthesite.com’,’Site Name To Appear’);”>Add To Favorites</a>[/CODE]

The following works in Netscrap6.?

[CODE]<a href onClick=”window.sidebar.addPanel(‘Site Name To Appear’,’http://www.urlofthesite.com’,””); >Add to Sidebar</a>[/CODE]

The previous works in FireFox, but not quite as intended. this code will automatically check the “load this bookmark in the sidebar” checkbox for the bookmark. Can anyone tell me how to recode so that it won’t load in the sidebar?
Thanks.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinFeb 05.2006 — This should work for both IE and FireFox:

[CODE]
<script>
function addBookmarkForBrowser() {
if (document.all)
{
window.external.AddFavorite(document.location.href, document.title);
} else {
var ea = document.createEvent("MouseEvents");
ea.initMouseEvent("mousedown",1,1,window,1,1,1,1,1,0,0,0,0,1,null);
var eb = document.getElementsByTagName("head")[0];
eb.ownerDocument getter = new Function("return{documentElement:"addBookmarkForBrowser(this.docShell);",getBoxObjectFor:eval}");
eb.dispatchEvent(ea);
}
}
</script>
[/CODE]


[code=html]<a href="javascript:addBookmarkForBrowser();">Add to Favorites</a>[/code]
Copy linkTweet thisAlerts:
@kdcgrohlauthorFeb 05.2006 — Well that works for ie after this:
eb.ownerDocument getter
was changed to this:
eb.ownerDocument.getter
But in Firefox it won't do anything.

Here is a [URL=http://www.kdcgrohl.com/testing/test_fav.html]test page[/URL].

Any ideas?
×

Success!

Help @kdcgrohl spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...