以下脚本将<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="chat-box-new-div">
<div class="chat-box-new-head">Frequently Asked Questions ..
</div>
<div class="panel-body chat-box-new">
<ul class="questionsUl">
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
</ul>
</div>
</div>
</div>
记录到控制台。有谁知道它带来了什么或带来了什么好处?
从简短的一瞥到Greasemonkey的源代码,我找不到任何修改false
的内容。同时查看Object
很难看到任何有意义的差异,所有函数仍然是本机代码。
Object
(在Greasemonkey&amp; Firefox上测试,不确定是否有Scriptish&amp; Chrome,但欢迎任何实验!)。
[注意:这个问题无关与// ==UserScript==
// @name test
// @namespace test
// @include *
// @grant none
// ==/UserScript==
console.log(window.Object == Object)
的问题有关,请先阅读问题本身,而不是在投票之前先看一下标题,谢谢!]。
答案 0 :(得分:3)
这是Mozilla当前沙箱流程的副作用。即使在@grant none
模式下,使用Components.utils.Sandbox的Greasemonkey沙箱脚本 - 仅关闭Xrays并在wantExportHelpers
处留下false
。
因此,您的window.Object == Object
相当于window.Object == this.Object
但是:在Greasemonkey脚本中,this
(root / global this)始终是Sandbox
个对象,而不是Window
。
Firefox可能有充分的理由像这样克隆Object
,但我找不到任何引用说法。
Chrome + Tampermonkey不会执行此操作,window.Object == Object
适用于Tampermonkey脚本,无论@grant
设置如何。
Chrome也不会以同样的方式进行沙盒化。