禁用注入的小部件

时间:2017-03-25 11:47:56

标签: javascript html

我正在编写Chrome扩展程序(使用html,javascript和css),即将小部件注入网站以显示其他信息。这个小部件的一部分是一个按钮。不幸的是,该网页捕获所有点击并使用自定义事件覆盖它们。结果是,单击按钮是不可能的。

是否有可能阻止这种"点击阻止机制"?

我查看了他们的javascript代码,似乎他们正在捕捉PointerEvents。

我真的很感激任何帮助。

编辑:

以下是我注入网页的按钮的代码(从其他页面获取):

HTML:

<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch">
<label class="onoffswitch-label" for="myonoffswitch"></label>

CSS:

.onoffswitch {
    position: relative; width: 60px;
    -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
    display: none;
}
.onoffswitch-label {
    display: block; overflow: hidden; cursor: pointer;
    height: 30px; padding: 0; line-height: 30px;
    border: 2px solid #999999; border-radius: 30px;
    background-color: #EEEEEE;
    transition: background-color 0.3s ease-in;
}
.onoffswitch-label:before {
    content: "";
    display: block; width: 30px; margin: 0px;
    background: #FFFFFF;
    position: absolute; top: 0; bottom: 0;
    right: 58px;
    border: 2px solid #999999; border-radius: 30px;
    transition: all 0.3s ease-in 0s; 
}
.onoffswitch-checkbox:checked + .onoffswitch-label {
    background-color: #34A7C1;
}
.onoffswitch-checkbox:checked + .onoffswitch-label, .onoffswitch-checkbox:checked + .onoffswitch-label:before {
   border-color: #34A7C1;
}
.onoffswitch-checkbox:checked + .onoffswitch-label:before {
    right: 0px; 
}

0 个答案:

没有答案