K-Meleon
KMeleonWiki > Resources > MacroLibrary > MacroLibrary2 > Open All Links
Submitted by: jsnj
Notes:
For K-Meleon v0.9b and above only. Copy the text highlighted in gray.
OpenAllLinks{ getpref(BOOL, $popups) == "true" ? &PB2 : &AllLinks; } PB2{ &PBToggle; &AllLinks; &PBToggle; } AllLinks{ $macro = "OpenAll"; &JSEnable; } OpenAll{ open("javascript:(function(){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[i].href)) ++n_to_open; } if (!n_to_open) alert ('no links'); else { if (confirm('Open ' + n_to_open + ' links in new windows?')) for (i = 0; i < dll; ++i) if (linkIsSafe(dl[i].href)) window.open(dl[i].href); } })();"); }
&File{ !New - %ifplugin layers layers(Next, Next Layer\tCtrl+Tab) layers(Prev, Previous Layer\tCtrl+Shift+Tab) Next Window = ID_WINDOW_NEXT Previous Window = ID_WINDOW_PREV %else Next Window\tCtrl+Tab = ID_WINDOW_NEXT Previous Window\tCtrl+Shift+Tab = ID_WINDOW_PREV %endif - &Open...\tCtrl+O = ID_FILE_OPEN macros(OpenAllLinks, Open All Links) %ifplugin layers macros(OpenLast, Open Last Session\tCtrl+Alt+L) %endif Save &As...\tCtrl+S = ID_FILE_SAVE_AS - !Print - Offline = !ID_OFFLINE - !Close }