返回列表 发帖
  1. <script language=JavaScript>
  2. var security_id=%tw_security_id;
  3. var author=external.readIni(security_id,"read_ini_ex","plugin.ini","self_var","author","xxx")
  4. alert(author);
  5. </script>
复制代码
这个写法不是太好,尤其是自动执行及比较多人用的插件,因为执行时及执行后 security_id 都有机会被恶意网页利用。其实直接用 %tw_security_id 就 ok 了:
  1. <script language=JavaScript>
  2. var author=external.readIni(%tw_security_id,"read_ini_ex","plugin.ini","self_var","author","xxx")
  3. alert(author);
  4. </script>
复制代码

TOP

原帖由 sky5 于 2008-4-9 21:10 发表 http://bbs.ioage.com/cn/images/common/back.gif
那个方式是为了传递security id的
var thUrl = window.location.href;
var security_id=%max_security_id;
var page = "";
window.open("","_blank");
external.get_tab(security_id,external.cur_sel).documen ...

variable 当然是有它的作用,但这种情况下不应该使用 variable。如果真的非要使用 variable 不可,至少在插件执行后也要清除 variable 的值,否则 %tw_security_id 便失去安全作用,不能防止网页使用某些插件专用函数。

TOP

返回列表