General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
(1) quicksearch (2) re-load to view source
Posted by: jed s.
Date: December 29, 2002 03:02AM

(1) the "search for text on the page auto-magically right after it loads" drives me nuts. i try to start typing text into google / login to webmail / etc., but no chance without busting out the mouse or tab, shift-tab. how do i shut that off?

(2) is the re-load to view source a gecko/netscape problem/design decision? i'd prefer to see the source of what's actually on the page, not what's on it the next time it loads.

these are probably both features, and i don't mean to offend anyone, particularly those who value them. however, i did want to get this feedback out there, and i would appreciate anyone who could help me remove feature number one.

i do appreciate the work that has been done paring down mozilla to a snappier size. and i'm thankful that you guys put out a .7 release after hiding an up-to-date k-meleon in cvs for so long.

~jed

Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: po
Date: December 29, 2002 07:20AM

i believe setting this pref will take care of the first complaint:

user_pref("accessibility.typeaheadfind", false);

Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: Hugo
Date: December 29, 2002 10:23PM

As for prob (2), this totally sucks:
ugly_source {
menu = "Ugly but Current Source";
$javascript_enabled = getpref(BOOL, "javascript.enabled") ;
setpref(BOOL, "javascript.enabled", true) ;
open("javascript: alert(document.body.innerHTML);")
setpref(BOOL, "javascript.enabled", $javascript_enabled) ;
}
..ooo, it sucks. But if it's an emergency..
(place in file macros.cfg .... and tweak menus.cfg to call the crap)

Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: jed s.
Date: December 29, 2002 11:27PM

why not... (some people leave out the body tag, plus this way you get the <head>, too)

open("javascript:{ var w=window.open();w.document.write( '<html><textarea rows=\'30\' cols=\'120\'>"+ document.documentElement.innerHTML +"</textarea></html>" ); }

Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: jed s.
Date: December 29, 2002 11:52PM

ok, attempt number 2...

open("javascript:window.open().document.write('<html><textarea rows=\'30\'cols=\'120\'>'+document.documentElement.innerHTML.replace(/textarea/gi,'text area')+'</textarea></html>')");

Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: Hugo
Date: December 30, 2002 01:21AM

Yep, you rule man!

I couldn't make that work in a macro though, only as bookmarklet.. It seems to work better for me when escaping the ':s (the ..eh.. blipps).

Also, you should close your streams after you're done :-)

ugly_source {
menu = "Ugly but Current Source";
$javascript_enabled = getpref(BOOL, "javascript.enabled") ;
setpref(BOOL, "javascript.enabled", true) ;
open("javascript: (srcdoc=window.open(\'\').document).write(\'<html><textarea rows=\\'30\\'cols=\\'100\\'>\'+document.documentElement.innerHTML.replace(/textarea/gi,\'text area\')+\'</textarea></html>\') ;srcdoc.close();");
setpref(BOOL, "javascript.enabled", $javascript_enabled) ;
}

But it only works with local files, right?

If it's local files that is important for you (you're obviously a developer?), check out the smart source thread[/u] .

And please post the merge here :-))

How do you get this to work non-locally? Security prefs? (Not important, just curious.)

/H


Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: Hugo
Date: December 30, 2002 01:23AM
Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: Hugo
Date: December 30, 2002 05:32AM

..and if you want to get a hold of the document.documentElement.outerHTML, you have some hints on
http://www.faqts.com/knowledge_base/view.phtml/aid/970/fid/126/lang/en

Options: ReplyQuote
Re: (1) quicksearch (2) re-load to view source
Posted by: Hugo
Date: December 30, 2002 07:07AM

... but why would you want that? I don't know. But a macro for it, stolen from faqts follows anyway.

enable_JS_outerHTML{
open("javascript: var emptyElements = { HR: true, BR: true, IMG: true, INPUT: true }; var specialElements = { TEXTAREA: true }; HTMLElement.prototype.outerHTML getter = function () { return getOuterHTML (this); }; function getOuterHTML (node) { var html = ''; switch (node.nodeType) { case Node.ELEMENT_NODE: html += '<'; html += node.nodeName; if (!specialElements[node.nodeName]) { for (var a = 0; a < node.attributes.length; a++) html += ' ' + node.attributes[a].nodeName.toUpperCase() + '='+'%22'+'' + node.attributes[a].nodeValue + ''+'%22'+''; html += '>'; if (!emptyElements[node.nodeName]) { html += node.innerHTML; html += '<\/' + node.nodeName + '>'; } } else switch (node.nodeName) { case 'TEXTAREA': for (var a = 0; a < node.attributes.length; a++) if (node.attributes[a].nodeName.toLowerCase() != 'value') html += ' ' + node.attributes[a].nodeName.toUpperCase() + '='+'%22'+'' + node.attributes[a].nodeValue + ''+'%22'+''; else var content = node.attributes[a].nodeValue; html += '>'; html += content; html += '<\/' + node.nodeName + '>'; break; } break; case Node.TEXT_NODE: html += node.nodeValue; break; case Node.COMMENT_NODE: html += '<!' + '--' + node.nodeValue + '--' + '>'; break; } return html; } ");
}

Ok, I'm gonna have to stop posting now.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.