lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Wishlist: Javascript protocol and EXTERNAL


From: Michael Warner
Subject: Re: lynx-dev Wishlist: Javascript protocol and EXTERNAL
Date: Tue, 1 Jul 2003 13:13:31 -0700 (PDT)

--- Morten Bo Johansen <address@hidden> wrote:
> No, no, I am not requesting javascript in Lynx, get your blood
> pressure down, please ;-) but I would like to be able to call an
> external program on a javascript link. Consider the following
> link
> 
>  javascript: var
> PAWin=window.open('/TGD/tgdBreakingNewsDisplay/0,,4,00.html')
> 
> which is just a pop up window which in turn appends the contents
> of the paranthesises to the basic URL of the host, in this case
> http://www.timesonline.co.uk.

YAY!  Another chance to beat the drum for CERNRULES, the
coolest unknown feature in lynx (that I know of :).  Thanks, Klaus.

Also, thanks to reloadable-on-the-fly config, the other coolest
feature in lynx (Thanks, Leonid), you can edit your rules, reload
them, and see if they work without leaving and restarting lynx.

I put the rules in their own file, call lynx with " -cfg=/path_to/rules ",
and include the regular lynx.cfg from the rules file.  That way if a rule
is screwing up, I can spawn a child lynx, via EXTERNAL, with
" -cfg=lynx.cfg " and skip the rules temporarily.

In /lynx_cfg_dir/rules.cfg :

---snip---
INCLUDE:/path_to/lynx.cfg

# So lynx will recognize " javascript: " as a usable protocol
RULE:UseProxy   javascript:*                                none

RULE:Redirect   "javascript: var PAWin=window.open('/*.html"
          http://www.timesonline.co.uk/*.html
---snip---

One limitation: you only get one wildcard per redirect, so you need
an original URL that meets some usability constraints.  The format
has to be predictable and specifiable such that you can pick out the
useful info in one chunk.  It may be that you could get "abcdef" out
of "xxxabcyyydefzzz" by chaining rules or something, but the thought
makes my head hurt right now, so you're on your own there.

cernrules.txt will tell you more than I'm ever likely to know on the subject.

Works a treat on those printer friendly redirects, too, transparently as
anything, as long as the site cooperates and you can get by with the
limited parsing capability.  That's what I used it for in the first place.
Maybe it'll save you some wheel-inventing.

On the other hand, if you could come up with script(s) or whatever that
were general enough to parse out the path info to tack onto the BASE,
and it worked well enough to be useful (considerably less than 100%
might still be useful), I for one would be interested.  Not JS, perhaps,
but a somewhat life-like facsimile?

I've shamefully drifted into following mozilla development and away from
daily use of lynx, so my rules file hasn't been maintained, but I'll tack it on
anyway, in case it's useful.  (Does Yahoo mutilate attachments?)

-- 
Mike

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]