aaa
bbb
ddd
某些对象需要足够的权限才能访问。
function privilegedAction() {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesRead");
var hp = navigator.preference("browser.startup.homepage");
alert("Permission to read preferences is granted. Your home page is "+hp);
} catch (e) {
alert("Permission to read preferences was denied.");
}
}
privilegedAction()
[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

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
今天使用firefox,突然发现一点小问题。前者用于IE,后者用于mozilla浏览器。
if(document.styleSheets[0].cssRules){
alert(document.styleSheets[0].cssRules[0].style.cssText)
}else{
alert(document.styleSheets[0].rules[0].style.cssText)
}
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
而且 rules 和 cssRules 的计数方法也是不一样的!
rules 是第几个选择器;cssRules 是第几条规则。分别用 IE 和 firefox 运行下面的代码可知。
if(document.styleSheets[0].cssRules){
alert(document.styleSheets[0].cssRules[1].selectorText+”:”+document.styleSheets[0].cssRules[1].style.cssText)
}else{
alert(document.styleSheets[0].rules[1].selectorText+”:”+document.styleSheets[0].rules[1].style.cssText)
}
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
guoshuang2006-06-15+opera干脆就没有 document.styleSheets 对象。需要直接把样式写进去。
mozilla 现在(2005.1)没有实现的就不说了…
| a b c |
| a b c |
| a b c |
| a b c |
| a b c |
| a b c |
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
:before :after 属于 CSS 2,以前只知道可添加文字内容,原来也可以加图片。
一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落一个段落
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
The negation pseudo-class
反选,其它为属性选择器(CSS 2)
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
直接和间接相邻选择器 Direct(Indirect) adjacent combinator
aaa
bbb
aaa
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
aaa
bbb
ddd
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
参考资料:
http://www.w3.org/TR/2001/CR-css3-selectors-20011113
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”
原先使用的是 document.frames,在 mozilla 中不起作用,其实应该是 window 对象的 frames。
修正 keso 365key 条目序号换行问题。