adsl宽带的广告劫执
最近发现在浏览网页的时候,时不时的会从页面底部冒出一个大广告,原来还以为是一些网站自已广告,后来却发现连我这个博客也会有,而我当然没放广告。
于是搜索,发现这种情况还很多,是关于联通或电信从中做的手脚。
BS之
经我放置钩子查出,这个广告是这样一个<script 标记:
<script src="http://content.clicklifter.com/ContentScripts520.0910-JS52.0.3120.1012.txt/FloatingContent/161/floating-frame.js?fp646" type="text/javascript"></script>
由此看出,要在本地屏蔽只需要在hosts文件中屏掉content.clicklifter.com即可,一劳永逸。
关于js的键盘事件
以前总结过各个浏览器中键盘事件的触发情况,可以看出keydown, keyup是比较靠谱的
因为它们是系统提供的比较底层的事件,对应的是键码keyCode标识了哪个键被按下(并不知道输入的是哪个字符)
keypress事件能够给出输入的可打印字符,但是这个事件在各个浏览器和操作系统中存在着很多不兼容性
在火狐中,在keypress中event.charCode保存了键入字符的ASCLL码,而其它的浏览器可以使用keyCode,
要想获得这个字符可以使用String.fromCharCode()
阻止默认行为
用户的键入是可以用js来阻止的,相关代码对应为IE的 returnValue=false;和标准浏览器的preventDefault();
实际中遇到的情况:
除了Opera,在keydown的时候阻止时就可以取消键入的事件
而Opera中需要在keypress的时候阻止。
WebIme测试版
一个通用的web输入法前端
目前实现了基本功能。
主要有:
- 左右键移动光标
- 上下键移动选词
- 自动翻页
- 全/半角
- 切换输入引擎
已测试的浏览器:
- firefox
- opera
- ie8
- chrome
已知兼容问题: IE6
测试地址:http://www.jatx.net/lib/webime/demo.html
有国为证:
UBUNTU下的ECLIPSE紧凑布局
很久都觉得乌班图里的ep布局太差了,写代码的空间被挤得剩下一点点,本本的屏就是小,没办法。昨天终于找到原来这些样式都是可以配置的,ubuntu果然强大。
首先在用户根目录新建.gtkrc和.gtkrc-2.0文件
内容:include "/home/你的帐户/.gtkrc.mine"
然后.gtkrc.mine的内容我从网上考了一种,并做了一些修改
style "gtkcompact" {
GtkButton::default_border={1,1,1,1}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=1
GtkButtonBox::child_min_heigth=1
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=1
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=1
GtkOptionMenu::indicator_size=1
GtkOptionMenu::indicator_spacing=1
GtkPaned::handle_size=4
GtkRange::trough_border=1
GtkRange::stepper_spacing=1
GtkScale::value_spacing=1
GtkScrolledWindow::scrollbar_spacing=1
GtkExpander::expander_size=10
GtkExpander::expander_spacing=1
GtkTreeView::vertical_separator=0
GtkTreeView::horizontal_separator=0
GtkTreeView::fixed_height_mode=TRUE
GtkTreeView::expander_size=9
GtkTreeView::expander_spacing=0
# GtkTreeView::expander_size=11
GtkTreeView::expander_indent=1
GtkTreeView::focus_line_width=1
GtkTreeView::spacing=0
GtkTreeView::row_ending_details=1
GtkTreeView::treeview_left=2
GtkTreeView::treeview_right=1
GtkTreeView::treeview_middle=1
GtkTreeView::passive_focus=0
GtkTreeView::separator_height=1
GtkTreeView::tree_line_pattern="\001\001"
GtkTreeView::grid_line_pattern="\001\001"
GtkTreeView::grid_line_width=1
GtkTreeView::tree_line_width=1
GtkWidget::focus_padding=1
}
class "GtkWidget" style "gtkcompact"style "gtkcompactextra" {
xthickness=1
ythickness=1
}
class "GtkButton" style "gtkcompactextra"
class "GtkToolbar" style "gtkcompactextra"
class "GtkPaned" style "gtkcompactextra"

