这个简单的代码不适用于Facebook页面.此代码仅在刷新页面时发出警报.如果我用我的鼠标在我的Facebook个人资料中访问该页面; 脚本停止工作.
没有警报或错误.:(
看起来整个脚本不起作用,直到我刷新.
// ==UserScript==
// @name Purge My Facebook
// @namespace http://www.arda.com
// @description test
// @include https://*.facebook.com*
// @include http://*.facebook.com*
// @version 1
// ==/UserScript==
window.setTimeout (isParent, 500);
function isParent () {
if (window.self == window.top) {
alert ("main window");
} else
window.setTimeout (isParent, 500);
}
Run Code Online (Sandbox Code Playgroud)
除此之外,我还试过这个:
// ==UserScript==
// @name Purge My Facebook
// @namespace http://www.arda.com
// @description test
// @include http://www.facebook.com/*/allactivity*
// @include https://www.facebook.com/*/allactivity*
// @version 1
// ==/UserScript==
try{
if …Run Code Online (Sandbox Code Playgroud)