没有样式就是最好的样式

Archive for January, 2005


mozilla 脚本的安全和签名

Jan 20, 2005 Author: | Filed under: Uncategorized

某些对象需要足够的权限才能访问。

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

原例子

原文在:

http://www.mozilla.org/projects/security/components/signed-script-example.html

配置 user.js

user_pref(”capability.policy.policynames”, “strict”);

user_pref(”capability.policy.strict.sites”, “http://www.evil.org http://www.annoying.com”);

user_pref(”capability.policy.strict.Window.alert”, “noAccess”);

user_pref(”capability.policy.strict.Window.confirm”, “noAccess”);

user_pref(”capability.policy.strict.Window.prompt”, “noAccess”);

还可以禁用 window screen 等对象的更多属性:

http://www.mozilla.org/projects/security/components/ConfigPolicy.html

权限(privileges)解释,以及怎样制作和使用 jar 签名脚本文件:

http://www.mozilla.org/projects/security/components/signed-scripts.html

jar 文件解释

JAR file

JAR (for Java Archive) is a format for associating digital signatures, security information, or other meta-data with a file or group of files. It is based on the common zip file format. The MIME-type application/java-archive is associated with jar files. In Mozilla, JAR files are accessed using the following URL format:

jar:http: //www.mozilla.org/projects/security/components/capsapp.jar!/getprefs.html

where capsapp.jar is the archive file, and getprefs.html is the desired file within capsapp.jar

原文在:

http://www.mozilla.org/projects/security/components/terms.html#jar

关于mozilla 安全组件

[Edit on 2005-1-20 16:30:44 By guoshuang]
[Edit on 2005-3-2 17:07:22 By guoshuang]

firefox window对象的visible

Jan 20, 2005 Author: | Filed under: Uncategorized

netscape 本来就有这些窗口子对象控制。但似乎不能跨域,只能在本机执行。

显示更多

类似的,window.locationbar, window.menubar, window.personalbar, window.scrollbars, window.statusbar, window.toolbar 这些对象也是可以控制的。

netscape.security.PrivilegeManager.enablePrivilege() 权限参考

UniversalBrowserRead

Reading of sensitive browser data.This allows the script to pass the same origin check when reading from any document.

UniversalBrowserWrite

Modification of sensitive browser data.This allows the script to pass the same origin check when writing to any document.

UniversalXPConnect

Unrestricted access to browser APIs using XPConnect.

UniversalPreferencesRead

Read preferences using the navigator.preference method.

UniversalPreferencesWrite

Set preferences using the navigator.preference method.

CapabilityPreferencesAccess

Read/set the preferences which define security policies, including which privileges have been granted and denied to scripts. (You also need UniversalPreferencesRead/Write.)

UniversalFileRead

* window.open of file:// URLs.

* Making the browser upload files from the user’s hard drive using
.

参考:

http://www.mozilla.org/projects/security/components/signed-scripts.html

http://www.mozilla.org/projects/security/components/index.html#links

[Edit on 2005-1-20 15:36:01 By guoshuang]

document.styleSheets[0].rules 与 cssRules

Jan 19, 2005 Author: | Filed under: Uncategorized

今天使用firefox,突然发现一点小问题。前者用于IE,后者用于mozilla浏览器。

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

而且 rules 和 cssRules 的计数方法也是不一样的!

rules 是第几个选择器;cssRules 是第几条规则。分别用 IE 和 firefox 运行下面的代码可知。

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

guoshuang2006-06-15+opera干脆就没有 document.styleSheets 对象。需要直接把样式写进去。

CSS 3 学习笔记

Jan 19, 2005 Author: | Filed under: Uncategorized

mozilla 现在(2005.1)没有实现的就不说了…

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

:before :after 属于 CSS 2,以前只知道可添加文字内容,原来也可以加图片。

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

The negation pseudo-class

反选,其它为属性选择器(CSS 2)

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

直接和间接相邻选择器 Direct(Indirect) adjacent combinator

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

参考资料:

http://www.w3.org/TR/2001/CR-css3-selectors-20011113

[Edit on 2005-1-19 14:35:32 By guoshuang]

定制 [^=] 样式

Jan 19, 2005 Author: | Filed under: Uncategorized

please see it with mozilla series browser.

运行代码 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

属于 CSS3 Attribute selectors(属性选择器)的内容:

E[foo^="bar"]

an E element whose “foo” attribute value begins exactly with the string “bar”

foo 属性值以 “bar” 开头

E[foo$="bar"]

an E element whose “foo” attribute value ends exactly with the string “bar”

foo 属性值以 “bar” 结束(类似正则的语法)

E[foo*="bar"]

an E element whose “foo” attribute value contains the substring “bar”

foo属性值中包含 “bar” 字符串

对比一下 CSS2 的属性选择器:

E[foo]

an E element with a “foo” attribute

有 foo 这个属性

E[foo="bar"]

an E element whose “foo” attribute value is exactly equal to “bar”

foo 属性的值就等于 “bar”

E[foo~="bar"]

an E element whose “foo” attribute value is a list of space-separated values, one of which is exactly equal to “bar”

foo 属性的多个值中(以空格分开的)有一个等于 “bar”

[Edit on 2005-1-19 13:23:11 By guoshuang]

document.frames 和 window.frames

Jan 18, 2005 Author: | Filed under: Uncategorized

原先使用的是 document.frames,在 mozilla 中不起作用,其实应该是 window 对象的 frames。

修正 keso 365key 条目序号换行问题。