hooks.rb

来自「一个很有名的浏览器」· RB 代码 · 共 75 行

RB
75
字号
# = hooks.rb - ELinks/Ruby hooks## == Module Constants## The following global module constants are defined## * ELinks::VERSION	- The ELinks version. :-P## * ELinks::HOME	- The path to ELinks configuration files## == Debugging Scripts## When debugging you can use either##	p(obj, ...)## or##	message(string)## to print message strings. The printed strings will be shown in a message# box.# Called when the user enters something into the goto URL dialog.def ELinks::goto_url_hook(url, current_url)    case url    when /^localhost$/	return "http://localhost/"    when /test-ruby/	# Dump the exported variables.	message(ELinks::VERSION + " - " + ELinks::HOME);	return current_url    end    return urlend# Called when the user decides to load some document by following a link,# entering an URL in the goto URL dialog, loading frames from a frameset (?)# etc.def ELinks::follow_url_hook(url)    return urlend# Called when a HTML document has been loaded - before the document rendering# begins. Makes it possible to fix up bad HTML code, remove tags etc.def ELinks::pre_format_html_hook(url, html)    return htmlend # Determining what proxy, if any, should be used to load a requested URL.# The hook should return:## * "PROXY:PORT" - to use the specified proxy# * ""		 - to not use any proxy# * nil		 - to use the default proxiesdef ELinks::proxy_hook(url)    return nilend# Called when ELinks quits and can be used to do required clean-upsdef ELinks::quit_hookend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?