best method for creating a universal extention/plugin

Posted by rashcroft44 on Stack Overflow See other posts from Stack Overflow or by rashcroft44
Published on 2010-01-19T08:45:20Z Indexed on 2010/06/12 11:02 UTC
Read the original article Hit count: 181

Hi,

I'm looking to create an extension for the leading browsers (firefox, safari and ie). Its rather simple, and I'm looking for the most efficient way to go about this.

I need to get the hostname of the current site the user is on, and if it matches a certain parameter(eg, mysite.org), I'll need to append to the link some extra data and refresh to the new link. What is the simplest way to go about this? (I don't want to go in the direction of a bookmarklet - since this would require the user to click. I'd like this to happen automatically)

sort of something like this:

if(window.location.hostname == 'mysite.org')
{
     location.replace(document.location.href + '/&mystuff=xyz');
}

Thanks!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about firefox-addon