General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Pages: 12Next
Current Page: 1 of 2
Save all links as Tabs?
Posted by: caktus
Date: February 21, 2009 06:35PM

Could someone alter "Save all links" to provide an option to save all links as tab rather than windows?

Thank you.

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 21, 2009 07:30PM

I will try, but first I have to find "Save All Links". Where is that item located?

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 21, 2009 07:54PM

@ James

Thank you James.

Here is the link to the "Open All Links." As "Open All Tabs" it would be a great addition to File > File All Tabs feature. And would be less resource intensive.

http://kmeleon.sourceforge.net/wiki/KmmOpenAllLinks

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: desga2
Date: February 21, 2009 08:47PM

@ caktus:
Can you explain more detailed that you exactlly like?

Because you talked about "Save All Links", and after you talk about "Open All Links" and posted a link to this macro.

Before you said "Open All Tabs", what's this, where's?

At the end you wrote: "File > File All Tabs feature" What is this feature, where's?

But first in title you wrote "Save all links as Tabs", how save? In Bookmarks, in Sessions, save as web page, what did you meant with "Save"? and the most important where?
:mad:

K-Meleon in Spanish

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 21, 2009 10:07PM

@ desga2

Sorry, my bad.

I meant to say "Open All Links." I realize it says For K-Meleon v.1.1.X. But I had been using successfully with 1.5.1. It seems to only open all links only in windows. It even gave me an option "Open All Links" in the context menu. I am hoping some one can re-wright so it will "Open All Links" in Tabs instead of windows. It would also be a useful companion to "File all tabs."

Now suddenly some of my KM1.5.1 menu items such as "File all tabs" "Open all links" "Configuration" and "Privacy" have disappeared. Yet settings and macors seem to be correct. And the Search button has stopped working. I can't even use the Enter key to start a search. Right now I am having to use FF to search. I think I'd better run some av/as scans and plan on starting KM over from scratch. I'm hoping that the problem is just a corrupted installation of KM.

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 21, 2009 10:08PM

@ caktus

I am confused. Do you want to open or save the links? The code that you referenced was to open links. I am trying to convert that from layers to tabs and use window diversion. Does anyone know to which pref this refers? getpref(BOOL, $pref_Popups)

This is my code so far:

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- OpenLinksAsTabs ---------------------------------------------------
#
# Dependencies        : main.kmm
# Resources        : -
# Preferences        : -
#
# -----------------------------------------------------------------------------

_OpenLinksAsTabs{
# Obtain current window diversion value:
$_PUB_value = getpref(INT, browser.link.open_newwindow);
$_PUB_value != 3 ? setpref("browser.link.open_newwindow", 3) : 0;
# Open all links in page:
&_OpenLAT;
# Restore current window diversion value:
$_PUB_value != 3 ? setpref("browser.link.open_newwindow", $_PUB_value) :0;
}

_OpenLAT{
injectJS("javascriptsad smileyfunction(){var n_to_open,dl,dll,i; function linkIsSafe(u) { if (u.substr(0,7)=='mailto:') return false; if (u.substr(0,11)=='javascript:') return false; return true; } n_to_open = 0; dl = document.links; dll = dl.length; for(i = 0; i < dll; ++i) { if (linkIsSafe(dl.href)) ++n_to_open; } if (!n_to_open) alert ('no links'); else { if (confirm('Open ' + n_to_open + ' links in new tabs?')) for (i = 0; i < dll; ++i) if (linkIsSafe(dl.href)) window.open(dl.href); } })();");
}

_OpenLinksAsTabs_BuildMenu{
$kTabs==true ? setmenu("NavTab",macro,"Open_Links","_OpenLinksAsTabs",4):0;
#setmenu("DocumentPopup",inline,"Open_Links",1);
#setmenu("Open_Links",separator,1);
#setmenu("Open_Links",macro,"Open All Links","OpenAllLinks",2);
}

$OnInit=$OnInit."_OpenLinksAsTabs_BuildMenu;";

# -----------------------------------------------------------------------------
$macroModules=$macroModules."OpenLinksAsTabs;";




Edited 1 time(s). Last edit at 02/22/2009 12:53AM by JamesD.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 21, 2009 10:29PM

Quote
JamesD
@ caktus

I am confused. Do you want to open or save the links? The code that you referenced was to open links.

Sorry about the confusion.sad smiley There is already a macro to open all links, but it opens them in individual windows. I want to open all links of a page in "Tabs" so I can file them all at one time using "File all tabs."

A feature to open all links in tabs (instead of windows) would be a convenient companion to the File all tabs feature and would consume less resources.

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 22, 2009 12:58AM

So far I have had no luck using window diversion to change the output. Prefs for opening in tabs - here http://kb.mozillazine.org/Browser.link.open_newwindow and here http://kb.mozillazine.org/Browser.link.open_newwindow.restriction seem to indicate we could force new windows to new tabs. So far I have not made it work.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 22, 2009 05:08PM

I think I have the code working now. So far I have only one menu location in the code. If this is what is needed more menu locations could be added.

I have found some pages where this javascript does no see the links. I don't know how to fix that.

OpenLinksAsTabs.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- OpenLinksAsTabs ---------------------------------------------------
#
# Dependencies        : main.kmm
# Resources           : -
# Preferences         : "browser.link.open_newwindow", 
#						"browser.link.open_newwindow.restriction",
#						"dom.disable_open_during_load"
# Version			  : 0.7  2/22/09  JamesD
# -----------------------------------------------------------------------------

_OpenLinksAsTabs{
# Obtain current window diversion values:
$_PUB_value1 = getpref(INT, "browser.link.open_newwindow");
$_PUB_value2 = getpref(INT, "browser.link.open_newwindow.restriction");
$_PUB_value3 = getpref(BOOL, "dom.disable_open_during_load");
# Review the current values:
#alert("newwindow " .$_PUB_value1 ."\n newwindow.res ".$_PUB_value2."\n dom.disable " .$_PUB_value3, "Original values DEBUG", INFO);
# Change window diversion values if needed
$_PUB_value1 != 3 ? setpref(INT,"browser.link.open_newwindow", 3):0 ;
$_PUB_value2 != 0 ? setpref(INT,"browser.link.open_newwindow.restriction", 0):0 ;
$_PUB_value3 != false ? setpref(BOOL,"dom.disable_open_during_load", false):0 ;
# Review new diversion settings:
#$_PUB_Rvalue1 = getpref(INT, "browser.link.open_newwindow");
#$_PUB_Rvalue2 = getpref(INT, "browser.link.open_newwindow.restriction");
#$_PUB_Rvalue3 = getpref(BOOL, "dom.disable_open_during_load");
#alert("newwindow " .$_PUB_Rvalue1 ."\n newwindow.res ".$_PUB_Rvalue2."\n dom.disable " .$_PUB_Rvalue3, "Macro Changed values DEBUG", INFO);
# Open all links in page:
&_OpenLAT;
id(ID_TAB_LAST);
# Restore current window diversion value:
$_PUB_value1 == $_PUB_Rvalue1 ? 0: setpref(INT,"browser.link.open_newwindow", $_PUB_value1) ;
$_PUB_value2 == $_PUB_Rvalue2 ? 0: setpref(INT,"browser.link.open_newwindow.restriction", $_PUB_value2) ;
$_PUB_value3 == $_PUB_Rvalue3 ? 0: setpref(BOOL,"dom.disable_open_during_load", $_PUB_value3) ;
}

_OpenLAT{
injectJS("javascriptsad smileyfunction(){var n_to_open,dl,dll,i; function linkIsSafe(u) { if (u.substr(0,7)=='mailto:') return false; if (u.substr(0,11)=='javascript:') return false; return true; } n_to_open = 0; dl = document.links; dll = dl.length; for(i = 0; i < dll; ++i) { if (linkIsSafe(dl.href)) ++n_to_open; } if (!n_to_open) alert ('no links'); else { if (confirm('Open ' + n_to_open + ' links in new tabs?')) for (i = 0; i < dll; ++i) if (linkIsSafe(dl.href)) window.open(dl.href); } })();");
}

_OpenLinksAsTabs_BuildMenu{
$kTabs==true ? setmenu("NavTab",macro,"Open_Links","_OpenLinksAsTabs",4):0;
}

$OnInit=$OnInit."_OpenLinksAsTabs_BuildMenu;";
$macroModules=$macroModules."OpenLinksAsTabs;";


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 23, 2009 12:47AM

Quote
JamesD
I think I have the code working now....

Thank you James. I will try it when I get a chance. But first, I have a new problem with KM that I can't seem to fix and I could sure use some help with it.

When I arrived home from work this evening, KM's menu bar was missing. The only way I could find the menu bar was to delete the contents profile.ini.
======================================
This default problem solved. Amazing what a browse through the FAQ can accomplish.

I seemed to be having a profile relate problem with 1.5.1 last night that I feared might be caused by a virus or spyware as I could not fix it. All macros had stopped working. I reapplied the macros but no success. I ran my anti-virus, anti-spyware and memory scanners from a command prompt and found no problems. Since I could not fix KM, I removed KM 1.5.1 from my computer and installed a good backup of 1.5.1. Everything was working fine last night. When I returned home from work this evening, the backup installation of 1.5.1 was no longer the default browser as all links would only open in IE6. I ran SetDefault.exe but it did not set KM as default browser. I also ran Set as default browser from Preferences > Browsing, but this also did not work.

The only way I can open a link in KM is to right click > select KM > select to always open this type of file with KM. Then the link will open in KM. But the next time I open the same link (or any link), it opens in IE6. The only other way I can open KM is to click on k-meleon.exe or the Loader.exe.

Somebody please heeelp meee!:s


Charlie

~~If it ain't broke, why screw it up?~~




Edited 1 time(s). Last edit at 02/23/2009 06:24AM by caktus.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 23, 2009 03:07AM

Quote
JamesD
---------- OpenLinksAsTabs ---------------------------------------------------
#


I tried this mac but it did not word. No appearant Nav link or button. Right click on Tab bar reveals Tabs > Options: K-Meleon::General, Save all links as tabs but they do not seem to have any funtion or I just don't get it (quite likely) I removed the "Open all links" mac in case it was causing conflict but still it did not work.

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 23, 2009 12:51PM

@ caktus

Only one menu item in this version. Right click on a tab. "Open_Links" will the next to last item in the drop down menu. Will work on more menu locations if this works as you desire.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: desga2
Date: February 23, 2009 01:43PM

There are some problems to post macros in forum due to BBcode and Smileys.
Please up macro codes to disrupted's availabe server or to MacroLibrary for this macro work fine.

Remember "[ i ]" is replaced for Italic BBcode in macros and ": (" is replaced by sad smiley.

I uploaded your macro code with some little changes:
OpenLinksAsTabs.kmm

(Remember rename the file extension from .txt to .kmm)

K-Meleon in Spanish



Edited 3 time(s). Last edit at 02/23/2009 01:52PM by desga2.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 23, 2009 09:34PM

@ desga2

Thanks for the fix and uploading. I did not know that the smiley remained when code downloaded. I thought it only appeared in forum. I see that you did the other menu items as well. More thanks for that.

I hope this is what Charlie wants. I see one problem ahead. There seems to be an upper limit on number of tabs. Maybe he will not do a page with more than 99 links.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 24, 2009 02:57AM

When I save the macro OpenLinksAsTabs.kmm to the macro folder, right clicking a tab or tab bar produces the same context menu as usual, except with out the Preferences option. And Configuration and MIME Types are missing from the Edit menu. When I remove OpenLinksAsTabs.kmm from macros, Configuration and MIME Types returns to the Edit menu and Options returns to the tabs context menu.

I have tested it several times to make sure I am properly coping/pasting the macro as per the OpenLinksAsTabs.kmm provided in Desga2’s post, and saving it as OpenLinksAsTabs.kmm and as All Files, as well as restarting the browser each time.

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 24, 2009 03:47AM

Found the problem. It is the last line in the file.
Delete everything after:
$macroModules=$macroModules."OpenLinksAsTabs;";

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: desga2
Date: February 24, 2009 12:05PM

Now fixed, sorry, problem with extension to upload.
Download again from same link.

K-Meleon in Spanish

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: caktus
Date: February 24, 2009 09:36PM

Thank you, Guy's. It works like a charm mow.smiling smiley

Charlie

~~If it ain't broke, why screw it up?~~


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: February 26, 2009 02:35PM

OpenLinksAsTabs.kmm has been entered into the MacroLibrary http://kmeleon.sourceforge.net/wiki/KmmOpenLinksAsTabs

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: magic48ges
Date: August 09, 2009 12:24AM

Hi,

although this macro gets relatively near to what I had with Linky in FF,
I still have some problems with the macro.

1. How can this macro be run with NoScript enabled?
In other words, what to tell NoScript to allow this macro?

2. After disabling NoScript, the macro asks me whether to open xxx links.
But after pressing OK it opens only about 25 new tabs.
Is there a way to get around this limit?

Thanks for your help:-)

Ray



Edited 2 time(s). Last edit at 08/09/2009 12:25AM by magic48ges.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: August 09, 2009 02:23AM

@ magic48ges

I see what you mean. I don't know why the limit. I worked on the conversion from layers to tabs for this macro, but I made no change to the "injectJS" code. If I have a single tab open and use the macro, I get only 20 additional tabs. I can find no coded limit in the macro. I will keep looking but I am not an expert on "JS" code.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: magic48ges
Date: August 09, 2009 12:08PM

I found out that in about:config entry "dom.popup_maximum" was set to 20,
which was the limit.
I set it to 200, and now KM opens more than 20 additional tabs.
However here comes the next limit:
KM doesn't seem to allow more than 80 open tabs:-(

Is there a way to set KM to allow more than 80 tabs?

Alternatively, would it be possible to change the macro
to open all _selected_ links in tabs?



Edited 1 time(s). Last edit at 08/09/2009 12:09PM by magic48ges.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: August 09, 2009 01:21PM

@ magic48ges

Good work finding that limit. I think I can fix the macro to handle that just like the other prefs that are changed.

Regarding the limit of 80, I found this in one of my earlier posts.
Quote

I hope this is what Charlie wants. I see one problem ahead. There seems to be an upper limit on number of tabs. Maybe he will not do a page with more than 99 links.
I am not sure where I got the number 99. You are finding that we can get only 80 tabs. I will try to do more research into the matter.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: August 09, 2009 05:01PM

@ magic48ges

The current limit on number of tabs does seem to be 80. I have made a change to OpenLinksAsTabs.kmm to account for that. You might give it a try and let me know if it works for you.

OpenLinksAsTabs.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- OpenLinksAsTabs ---------------------------------------------------
#
# Dependencies        : main.kmm, Ver. 1.5.x, Tabs
# Resources           : -
# Preferences         : "browser.link.open_newwindow", 
#                       "browser.link.open_newwindow.restriction",
#                       "dom.disable_open_during_load"
#                       "dom.popup_maximum"
# Version             : 1.1  8/09/09  JamesD & desga2
# -----------------------------------------------------------------------------

_OpenLinksAsTabs{
# Obtain current window diversion values:
$_PUB_value1 = getpref(INT, "browser.link.open_newwindow");
$_PUB_value2 = getpref(INT, "browser.link.open_newwindow.restriction");
$_PUB_value3 = getpref(BOOL, "dom.disable_open_during_load");
$_PUB_value4 = getpref(INT, "dom.popup_maximum");
# Change window diversion values if needed
$_PUB_value1 != 3 ? setpref(INT,"browser.link.open_newwindow", 3):0 ;
$_PUB_value2 != 0 ? setpref(INT,"browser.link.open_newwindow.restriction", 0):0 ;
$_PUB_value3 != false ? setpref(BOOL,"dom.disable_open_during_load", false):0 ;
setpref(INT,"dom.popup_maximum", 80-$TabNumber) ;
# Open all links in page:
&_OpenLAT;
id(ID_TAB_LAST);
# Restore current window diversion value:
$_PUB_value1 == getpref(INT, "browser.link.open_newwindow") ? 0: setpref(INT,"browser.link.open_newwindow", $_PUB_value1) ;
$_PUB_value2 == getpref(INT, "browser.link.open_newwindow.restriction") ? 0: setpref(INT,"browser.link.open_newwindow.restriction", $_PUB_value2) ;
$_PUB_value3 == getpref(BOOL, "dom.disable_open_during_load") ? 0: setpref(BOOL,"dom.disable_open_during_load", $_PUB_value3) ;
$_PUB_value4 == getpref(INT, "dom.popup_maximum") ? 0: setpref(INT,"dom.popup_maximum", $_PUB_value4) ;
}

_OpenLAT{
injectJS("javascriptsad smileyfunction(){var n_to_open,dl,dll,i; function linkIsSafe(u) { if (u.substr(0,7)=='mailto:') return false; if (u.substr(0,11)=='javascript:') return false; return true; } n_to_open = 0; dl = document.links; dll = dl.length; for(i = 0; i < dll; ++i) { if (linkIsSafe(dl.href)) ++n_to_open; } if (!n_to_open) alert ('no links'); else { if (confirm('Open ' + n_to_open + ' links in new tabs?')) for (i = 0; i < dll; ++i) if (linkIsSafe(dl.href)) window.open(dl.href); } })();");
}

_OpenLinksAsTabs_BuildMenu{
# Add "Open Links in Tabs" option to tab bar right click context menu:
$kTabs==true ? setmenu("NavTab",macro,_("Open Links in Tabs"),"_OpenLinksAsTabs",4):0;
# Add "Open Links in Tabs" option to right click context menu:
$kTabs==true ? setmenu("Nav",separator, -1):0;
$kTabs==true ? setmenu("Nav",macro,_("Open Links in Tabs"),"_OpenLinksAsTabs"):0;
}

$OnInit=$OnInit."_OpenLinksAsTabs_BuildMenu;";
$macroModules=$macroModules."OpenLinksAsTabs;";


Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: desga2
Date: August 09, 2009 10:07PM

Quote
magic48ges
Alternatively, would it be possible to change the macro
to open all _selected_ links in tabs?

With "selected links" do you like said links selected as text selection?
Like "Open As URL" context option with selected text but when selected text are some links?

This is easy to do with a macro, you have selected text (the links in this case) in $SelectedText global var and I guess this are separated by new line (\n) and you can use this macro commands to extract links from $SelectedText:

$SUB = substr( s, i [, n] );

Returns the at most n-character substring of s starting at i. If n is omitted, the rest of s is used.

$I = index( s, t );

Returns the index of the string t in the string s, or -1 if t is not present.

When you extracted the link open it in new tab with OpenURL_InNew macro function;
$OpenURL=$SelectedLink; $OpenURL==""?0:&OpenURL_InNew;

And yes it's, K-Meleon 1.5.x have a limit of 80 tabs opened. You can look it in code:
#define MAX_TABS_NUMBER				   80

K-Meleon in Spanish



Edited 2 time(s). Last edit at 08/09/2009 10:16PM by desga2.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: JamesD
Date: August 09, 2009 11:46PM

@ desga2

$SelectedText variable only has the screen text. It does not have the URL from the source behind the text.

Options: ReplyQuote
Re: Save all links as Tabs?
Posted by: desga2
Date: August 10, 2009 06:34AM

Yes, you are right, but this will work in links with same text and URL link as Rapidshare or Mediafire links.

K-Meleon in Spanish

Options: ReplyQuote
Open selected links as Tabs?
Posted by: magic48ges
Date: August 10, 2009 04:57PM

@All:

I think we have a solution for "Open selected links in Tabs" :-)

Some years ago, someone actually wrote a JS code slice which does just that: Open selected links in tabs - Yippiee!
The source link is in the macro header. That link also references the site owner (Jesse Ruderman), who may be the author, and which in turn was inspired by Matthew Tuck's suggestion on Mozilla bug 9274.

So I took the macro frame from JamesD & desga2,
changed the context menu target,
and replaced the former JS code slice with the one from this site

There have to be made some refinements, like a warning msgbox which tell the user whether he selected too many links before actually starting the open tabs loop.

And maybe a filter utilitiy...

Have fun:-)


# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- OpenLinksAsTabs ---------------------------------------------------
#
# Dependencies        : main.kmm, Ver. 1.5.x, Tabs
# Resources           : -
# Preferences         : "browser.link.open_newwindow",
#                       "browser.link.open_newwindow.restriction",
#                       "dom.disable_open_during_load"
#                       "dom.popup_maximum"
# External References :	javascript code: https://www.squarefree.com/bookmarklets/pagelinks.html (Bookmarklet: open selected links)
# Version             : 1.1  8/09/09  JamesD & desga2
#			1.01 8/10/09  JamesD & desga2 & Magic48ges (Adaption)
# -----------------------------------------------------------------------------

_OpenSelectedLinksAsTabs{
# Obtain current window diversion values:
$_PUB_value1 = getpref(INT, "browser.link.open_newwindow");
$_PUB_value2 = getpref(INT, "browser.link.open_newwindow.restriction");
$_PUB_value3 = getpref(BOOL, "dom.disable_open_during_load");
$_PUB_value4 = getpref(INT, "dom.popup_maximum");
# Change window diversion values if needed
$_PUB_value1 != 3 ? setpref(INT,"browser.link.open_newwindow", 3):0 ;
$_PUB_value2 != 0 ? setpref(INT,"browser.link.open_newwindow.restriction", 0):0 ;
$_PUB_value3 != false ? setpref(BOOL,"dom.disable_open_during_load", false):0 ;
setpref(INT,"dom.popup_maximum", 80-$TabNumber) ;

# Open all links in page:
&_OpenLAT;
id(ID_TAB_LAST);
# Restore current window diversion value:
$_PUB_value1 == getpref(INT, "browser.link.open_newwindow") ? 0: setpref(INT,"browser.link.open_newwindow", $_PUB_value1) ;
$_PUB_value2 == getpref(INT, "browser.link.open_newwindow.restriction") ? 0: setpref(INT,"browser.link.open_newwindow.restriction", $_PUB_value2) ;
$_PUB_value3 == getpref(BOOL, "dom.disable_open_during_load") ? 0: setpref(BOOL,"dom.disable_open_during_load", $_PUB_value3) ;
$_PUB_value4 == getpref(INT, "dom.popup_maximum") ? 0: setpref(INT,"dom.popup_maximum", $_PUB_value4) ;
}

_OpenLAT{
injectJS("javascriptsad smileyfunction(){var n_to_open,dl,dll,i;function linkIsSafe(u){if (u.substr(0,7)=='mailto:') return false; if (u.substr(0,11)=='javascript:') return false; return true;}	n_to_open = 0; dl = document.links; dll = dl.length; if (window.getSelection && window.getSelection().containsNode) { /* mozilla */ for(i=0; i<dll; ++i) { if (window.getSelection().containsNode(dl, true) && linkIsSafe(dl.href)) ++n_to_open; } if (n_to_open && confirm('Open ' + n_to_open + ' selected links in new windows?')) { for(i=0; i<dll; ++i) if (window.getSelection().containsNode(dl, true) && linkIsSafe(dl.href)) window.open(dl.href); } } /* /mozilla */ if (!n_to_open)	{ /*ie, or mozilla with no links selected: this section matches open_all_links, except for the alert text */ for(i = 0; i < dll; ++i) { if (linkIsSafe(dl.href)) ++n_to_open; } if (!n_to_open) alert ('no links'); else { if (confirm('No links selected.  Open ' + n_to_open + ' links in new windows?')) for (i = 0; i < dll; ++i) if (linkIsSafe(dl.href)) window.open(dl.href); } } }) ();");
}

_OpenSelectedLinksAsTabs_BuildMenu{
# Add "Open selected Links in Tabs" option to tab bar right click context menu:

setmenu(Selection,macro,"Open selected links in Tabs",_OpenSelectedLinksAsTabs,1);
}

$OnInit=$OnInit."_OpenSelectedLinksAsTabs_BuildMenu;";
$macroModules=$macroModules."OpenSelectedLinksAsTabs;";


Options: ReplyQuote
Re: Open selected links as Tabs?
Posted by: JamesD
Date: August 10, 2009 05:40PM

@ magic48ges

I am not getting anything to happen when I try your new code. I fixed the sad smiley. I put an alert to tell me I am just before the injectJS, but I don't get any tabs. How am I to select the links? Do I just highlight an area of the page that contains links?

Options: ReplyQuote
Re: Open selected links as Tabs?
Posted by: magic48ges
Date: August 10, 2009 07:22PM

@ JamesD:

I just checked, it's the same problem as with some other listings here,
although I used the code tags, which should let the text between untouched,
the small i in square brackets just disappeared, like in window.open(dl[_i_].href)
The JS code works fine after re-inserting the bracketed i (w/o underscores).

Maybe we should use another char for the index variable,
so that this implicit and unwanted formatting doesn't take place...



Edited 3 time(s). Last edit at 08/10/2009 07:26PM by magic48ges.

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


K-Meleon forum is powered by Phorum.