Do extensions work in other browsers?
-
- Posts: 8
- Joined: February 18th, 2007, 12:50 pm
Thanks, You've been a big help. I have one last favor to ask though. Could you write out an example function so that I can be sure I get it right? This is my first project so I'm not very good yet. Would you like to be listed as Philip Chee on the contributors list, or would you prefer a different name?
- Philip Chee
- Posts: 6475
- Joined: March 1st, 2005, 3:03 pm
- Contact:
I found a useful article on the mozine knowledgebase:
http://kb.mozillazine.org/Open_page_using_tab_settings
The following code (I found in the context search extension) might be a bit of an overkill:
Phil
http://kb.mozillazine.org/Open_page_using_tab_settings
The following code (I found in the context search extension) might be a bit of an overkill:
Code: Select all
search : function(aEvent, aDefault) {
if (!aEvent.target.id)
return;
var searchUrl = null;
if (!aDefault) {
searchUrl = contextsearch.geturl(aEvent.target.id, gContextMenu.searchSelected());
}
else {
var defaultEngine = contextsearch.getCharPref("browser.search.defaultengine");
if (!defaultEngine)
return;
searchUrl = contextsearch.geturl(defaultEngine, gContextMenu.searchSelected());
}
var loadInBackgroundPref = contextsearch.getBoolPref("browser.tabs.loadInBackground");
var loadInNewTabPref = contextsearch.getBoolPref("browser.search.opentabforcontextsearch", true);
var loadInForeground = false;
var loadInNewTab = false;
if (aEvent.button != undefined) {
loadInForeground = loadInBackgroundPref ? aEvent.ctrlKey : !aEvent.ctrlKey;
loadInNewTab = loadInNewTabPref ? !aEvent.shiftKey : aEvent.shiftKey;
}
else {
loadInForeground = loadInBackgroundPref ? false : true;
loadInNewTab = loadInNewTabPref;
}
if (!loadInNewTab) {
openNewWindowWith(searchUrl);
}
else {
var newTab = getBrowser().addTab(searchUrl);
if (loadInForeground) {
window.getBrowser().selectedTab = newTab;
}
}
document.getElementById("contentAreaContextMenu").hidePopup();
},
None of this code is mine, so you shouldn't list me as a contributor.Would you like to be listed as Philip Chee on the contributors list
Phil
- Philip Chee
- Posts: 6475
- Joined: March 1st, 2005, 3:03 pm
- Contact:
I think I'll still decline. But thanks for the offer anyway.Jukilum wrote:I know that none of the code is yours, but you helped me which makes you a contributer.
Phil (has way too many google hits already - 15,400)
-
- Posts: 0
- Joined: December 31st, 1969, 5:00 pm
I don't know how well this will perform in something that's not Firefox, but here's a much easier way.