Re: [elinks-dev] [PATCH] rewrite: add default ddg dumb/smart prefixes for DuckDuckGo

2012-09-19 Thread Kalle Olavi Niemitalo
Kamil Dudka kdu...@redhat.com writes:

 + INIT_OPT_SMART_PREFIX(ddg, https://duckduckgo.com/?q=%st=elinks;),

ELinks can be built without SSL/TLS support, in which case it
will pop up an error message when asked to open an https URL.
This may be why all the other prefixes use http rather than
https.  If you want to use https whenever possible, you can do
this:

#ifdef CONFIG_SSL
INIT_OPT_SMART_PREFIX(ddg, https://duckduckgo.com/?q=%st=elinks;),
#else
INIT_OPT_SMART_PREFIX(ddg, http://duckduckgo.com/?q=%st=elinks;),
#endif

However, there is a risk that the http variant might get saved to 
~/.elinks/elinks.conf, in which case ELinks will keep using that
even if the user later installs an SSL/TLS-capable ELinks binary.
Such saving happens if the user edits the rewriting rule, or if
the user sets config.saving_style = 1 or 2.  I don't know whether
this risk is so bad you'd prefer using https unconditionally.

The t=elinks parameter at the end makes me feel a bit uneasy.
None of the other prefix definitions has anything like that,
perhaps indicating the prefixes were added without consulting the
webmasters.  On the other hand, because ELinks by default reveals
its name in the User-Agent header, it is OK to include t=elinks
here too.  It might however deserve a note in the documentation
of protocol.http.user_agent:

diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c
index e58c7af..14f89f8 100644
--- a/src/protocol/http/http.c
+++ b/src/protocol/http/http.c
@@ -204,7 +204,8 @@ static struct option_info http_options[] = {
pushing some lite version to them automagically.\n
\n
Use \ \ if you don't want any User-Agent header to be sent 
-   at all.\n
+   at all. URI rewriting rules may still include parameters 
+   that reveal you are using ELinks.\n
\n
%v in the string means ELinks version,\n
%s in the string means system identification,\n


pgp50eJGmVGR2.pgp
Description: PGP signature
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] [PATCH] rewrite: add default ddg dumb/smart prefixes for DuckDuckGo

2012-09-18 Thread Prakash Swaminathan
Thanks, Kamil!

Elinks-dev:  Happy to answer any questions you might have.

Thanks,
Prakash

On Tue, Sep 18, 2012 at 7:09 PM, Kamil Dudka kdu...@redhat.com wrote:
 Originally requested at https://bugzilla.redhat.com/856348.
 ---
  src/protocol/rewrite/rewrite.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

 diff --git a/src/protocol/rewrite/rewrite.c b/src/protocol/rewrite/rewrite.c
 index dd5c7ab..b87fd99 100644
 --- a/src/protocol/rewrite/rewrite.c
 +++ b/src/protocol/rewrite/rewrite.c
 @@ -121,6 +121,7 @@ static struct option_info uri_rewrite_options[] = {
 INIT_OPT_DUMB_PREFIX(cia, http://cia.navi.cx/;),
 INIT_OPT_DUMB_PREFIX(b, 
 http://babelfish.altavista.com/babelfish/tr;),
 INIT_OPT_DUMB_PREFIX(d, http://www.dict.org;),
 +   INIT_OPT_DUMB_PREFIX(ddg, https://duckduckgo.com/?t=elinks;),
 INIT_OPT_DUMB_PREFIX(g, http://www.google.com/;),
 INIT_OPT_DUMB_PREFIX(gg, http://www.google.com/;),
 INIT_OPT_DUMB_PREFIX(go, http://www.google.com/;),
 @@ -158,6 +159,7 @@ static struct option_info uri_rewrite_options[] = {
 INIT_OPT_SMART_PREFIX(cambridge, 
 http://dictionary.cambridge.org/results.asp?searchword=%s;),
 INIT_OPT_SMART_PREFIX(cliki, 
 http://www.cliki.net/admin/search?words=%s;),
 INIT_OPT_SMART_PREFIX(d, 
 http://www.dict.org/bin/Dict?Query=%sForm=Dict1Strategy=*Database=*submit=Submit+query;),
 +   INIT_OPT_SMART_PREFIX(ddg, https://duckduckgo.com/?q=%st=elinks;),
 INIT_OPT_SMART_PREFIX(dmoz, 
 http://search.dmoz.org/cgi-bin/search?search=%s;),
 INIT_OPT_SMART_PREFIX(foldoc, 
 http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?%s;),
 INIT_OPT_SMART_PREFIX(g, 
 http://www.google.com/search?q=%sbtnG=Google+Search;),
 --
 1.7.1




-- 
Prakash Swaminathan,  https://duckduckgo.com/
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev