MozillaZine

New ext: Open Link/img in Background Tab, in context menu

Talk about add-ons and extension development.
Mozcerize
 
Posts: 159
Joined: July 30th, 2004, 1:13 pm

Post Posted August 25th, 2004, 6:14 am

(I'll happily include any new locales that people provide!)

NAME:
Open link in...

TARGET:
Firefox 4 and below.

DOWNLOAD:
See later post below.


NOTE: I have no plans to change existing keyboard and mouse shortcuts, nor to implement new ones in this extension. This would be quite complicated, as it would have to override lots of defaults set up elsewhere. Indeed, the main point of this extension is to provide the missing graphical UI which corresponds to the existing keyboard and mouse shortcuts which the application provides for opening links.


FUNCTIONALITY:
Adds items to the "right-click" context menu (CM) for links, images and background images in a webpage.

* Open in New Tab honours the user's tab opening default as specified in
Tools -> Options | Tabs | Select new tabs opened from links.
Only one of 'Open in Background Tab', 'Open in Foreground Tab' appears, according to the opposite of the user's default.

The context menu items are:

When right-clicking a Link
-----------------------------
The context menu contains either the following new items in addition to the standard "Open Link in New Tab" and "Open Link in New Window":

Open Link in Background Tab *
Open Link in Foreground Tab *
Open Link in Background Window
Open Link Here [ie in the current tab/window]

or, if the user prefers, all link menu items are removed and replaced with a new CM submenu called "Open Link in..." containing:

New Tab
Background Tab *
Foreground Tab *
New Window
Background Window
Here [ie in the current tab/window]

When right-clicking Images and Background Images
------------------------------------------------------------
The standard "View (Background) Image" menu items are removed and replaced with new CM subfolders called "View (Background) Image in..." which provide:
Background Tab *
Foreground Tab *
New Tab *
Background Window
New Window
Here [ie in the current tab/window]


IMPLEMENTATION NOTES:
Open in Background Window is not ideal. It opens a foreground window and then hits the original window with a second's-worth of focus() calls. Listening out for onFocus and onLoad signals doesn't help, because although these are issued by the new window, it hasn't yet focused when onLoad is issued, and it focuses a second time after it has issued onFocus but doesn't reissue it for that second time!

Apparently there is no pre-existing function which allows for opening in background. Let me know if you know a better way!


CHECK-IN NOTES:
This extension is trivial! It took a couple of lines of tweaks to existing Fx code to produce. Checking the code into the main build is bug-free and easy, if anyone is interested.
Last edited by Mozcerize on April 26th, 2011, 8:48 am, edited 14 times in total.

Mozcerize
 
Posts: 159
Joined: July 30th, 2004, 1:13 pm

Post Posted September 21st, 2004, 4:13 am

I've updated the compatibility information to allow installation on Fx 1.0. (Use the same download link.)

OldSavage
 
Posts: 1
Joined: October 13th, 2004, 4:49 am

Post Posted October 13th, 2004, 5:01 am

Is it possible to setup this extension to use Ctrl+Shift+LeftClick for opening a link in backgound window, as it is in Opera?

TheOneKEA

User avatar
 
Posts: 4864
Joined: October 16th, 2003, 5:47 am
Location: Somewhere in London, riding the Underground

Post Posted October 13th, 2004, 5:21 am

Proud user of teh Fox of Fire
Registered Linux User #289618

DMCrimson
 
Posts: 1022
Joined: February 13th, 2004, 6:11 am

Post Posted October 13th, 2004, 12:17 pm

yummy!

Mozcerize
 
Posts: 159
Joined: July 30th, 2004, 1:13 pm

Post Posted November 13th, 2004, 8:22 am

I have updated this extension to cope with the fact that tabs now open in the background by default.

VERSION:
1.1

TARGET:
Fx 0.9 - 1.0.
Also includes old install routine for Moz 1.x, Fx <0.9 but this is untested.

DOWNLOAD:
See later post below.

FUNCTIONALITY:
Functionality updated in newer version: see later post below.
Last edited by Mozcerize on July 10th, 2009, 8:16 am, edited 3 times in total.

blrender
 
Posts: 8
Joined: July 28th, 2004, 4:03 pm

Post Posted December 1st, 2004, 6:57 pm

heyas mozercise;

thanks a tonne and a half for including the 'open in background window'! :) alas, it doesn't seem to work for me. i tried to leave it alone for a few seconds to see if it jumped focus back to my original window, but it doesn't. :/

would it be possible to open the link in a new window that is then minimized? that's what i do when i'm stuck with ie at work, open in new window, then slap the minimize button while it's loading.

kalirion
 
Posts: 9
Joined: August 25th, 2004, 10:18 am

Post Posted December 3rd, 2004, 8:05 am

Hello,

This may be a problem with Firefox, but I can't seem to uninstall this extension. On the extensions screen I'm told that it will be uninstalled next time I start Firefox, but it's not happening. I even rebooted - no effect.

Edit: Nevermind, I tried uninstalling another extension (the 1.0 incompatible BugMeNot), and now that one is having the same problem while this one finally uninstalled. Weird...

Anyway, would it be possible for a future release to have the order of the new context-menu items be customizable? I'm just too used to having "Open Link in New (background) Tab" be the second one from the top.

Mozcerize
 
Posts: 159
Joined: July 30th, 2004, 1:13 pm

Post Posted December 3rd, 2004, 8:28 am

kalirion wrote:I can't seem to uninstall this extension.


Hi kalirion. This is a Firefox problem. (No extension for Fx>0.9 has control over its installation and uninstallation.) Check out the Knowledge Base (link on the right-hand side of this forum) for how to deal with this problem. Good luck!

blrender: thanks for the info; an update is on it's way. Unfortunately a subtle typo found its way into version 1.1, which stopped the background window feature from working properly:-/ I'll post here again when the new version is on update.mozilla.org.

kenk
 
Posts: 16
Joined: November 27th, 2004, 6:05 pm
Location: Ontario, Canada

Post Posted December 3rd, 2004, 7:10 pm

Hi kalirion

You asked: "would it be possible for a future release to have the order of the new context-menu items be customizable?"

Would this help: http://menueditor.mozdev.org/

kalirion
 
Posts: 9
Joined: August 25th, 2004, 10:18 am

Post Posted December 6th, 2004, 7:15 am

Thanks for the link kenk!

Two questions though: do you know why this extension isn't listed on the official firefox extensions page, and why firefox gives the message "To protect your computer, Firefox prevented this site (menueditor.mozdev.org) from installing software of this computer."? I've never gotten that message before when attempting to install an extension...

Mozcerize
 
Posts: 159
Joined: July 30th, 2004, 1:13 pm

Post Posted December 6th, 2004, 7:33 am

The warning is a new thing for Firefox 1.0. Any site other than the "official" one (update.mozilla.org) which supplies extensions will produce this warning. You can choose to mark trusted sites as safe so that you are not warned again when using them---right-click the yellow information bar which appears at the top of the page. This whole thing is just a safety mechanism for beginners.

Menuedit isn't listed yet because it is still in a testing stage (I think). There's a menuedit thread on this forum---have a search for it.

cjparsons1
 
Posts: 2
Joined: December 7th, 2004, 5:46 am

Post Posted December 7th, 2004, 5:51 am

Can anyone help me work out how to add "open in background tab" as a gesture option using either easyGestures 2.14 or Mouse Gestures 1.0? The latter has support for custom commands but I'm not sure how to refer to the new "open in background tab" command. Ta.

Mozcerize
 
Posts: 159
Joined: July 30th, 2004, 1:13 pm

Post Posted December 7th, 2004, 6:42 am

This is something that the extension "Open Link in..." can't help you with unfortunately. The new "Open in background tab" command isn't really new, it was always there as a keyboard shortcut. This extension simply adds the corresponding item to the context menu.
Because your question is really a general question about opening tabs, you will probably get more views if you asked it in a new (well-titled!) thread, or in the relevant threads (if they exist) for the gestures extensions you mention. Good luck!

cjparsons1
 
Posts: 2
Joined: December 7th, 2004, 5:46 am

Post Posted December 7th, 2004, 7:25 am

Thank you Mozcerize, I've only just started using Firefox from IE but had a brief fling with Opera in between. I didn't realise that opening links to a background tab was the default until I read the help just now (RTFM...) after your advice. I think I must have gone crazy when I first went through the options screen and ticked all the boxes related to tabs, without realising what 'select new tabs opened from links' meant. No need for a gesture then, just use my middle button.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 0 guests