facebook - 删除你可能认识的人

时间:2011-05-04 00:58:37

标签: facebook greasemonkey

我现在正在进入Facebook。弹出的那些“你可能知道的人”部分让我分心,而我只是想摆脱它。

我有一个paintmonkey脚本,但它不起作用。没有多个发布的Greasemonkey脚本可以删除它。

在facebook页面的源代码中,“你可能知道的人”(PYMK)部分是一个脚本元素,它只包含一个非常长的函数调用,即

<script>big_pipe.onPageletArrive({"phase":1,"id":"pagelet_ego_pane","is_last":true,"css":["30YXW","MA+x5"],"js":["uBXoU","LNwoY","NavLF","ZtuLL"],"onload":["window.__UIControllerRegistry[\"c4dc09ff06275f0732488206\"] = new UIPagelet(\"c4dc09ff06275f0732488206\", 
...

所以我只是想删除那个脚本元素,我尝试将其作为第一遍:

function Remove_PYMK() {


  var scripts = document.getElementsByTagName('script');    


  for (n=0; n<scripts.length; n++) {    
    if (scripts[n].innerHTML.indexOf("People You M") >=0) { 
      scripts[n].style.visibility="hidden";
      alert ("found it");   
    }   
  } 


}


Remove_PYMK();

//document.addEventListener("onload", Remove_PYMK, true);

它找到它,它只是不会删除它。

不用说,这是一种混合物。有没有正确的方法来禁用PYMK,还有,防止我的名字出现在PYMK的其他人页面上。

编辑:

这是整个脚本节点,直到字符串“你可能知道的人”(FWIW):

<script>
    big_pipe.onPageletArrive({
        "phase": 1,
        "id": "pagelet_ego_pane",
        "is_last": true,
        "css": ["30YXW", "MA+x5"],
        "js": ["uBXoU", "LNwoY", "NavLF", "ZtuLL"],
        "onload": ["window.__UIControllerRegistry[\"c4dc09ff06275f0732488206\"] = new UIPagelet(\"c4dc09ff06275f0732488206\", \"\\\/pagelet\\\/generic.php\\\/WebEgoPane\\\/\", {}, {});; ;", "new EmuController(\"6002939839588-id_4dc09ff0611f60c83869379\", \"AQBsgeDBRnJ4uiUuieZs681Fm3aqB5-626iHBbItdNfF5TWZZJ-9dZ60xyVaJr7JfimJpKgKNxXqF_DH_aHjru3RItUcHs2gI_ZLQNYdIENRSM5zh_pcjiDZyN7vv0trj5UDBOfXp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gnXXBJciYrQzWM-vSvODcV1dKTb5tSxO81Uswl-3Uo9Jf_VzfUgoKdeHyQeem31WMUmYm9kxCOVvKy4p7sE09GQoAfPBoz4MOrAgs3MFBFzpwIvKyZGvE6cX8haiK4POdP1zrEnMLFDyF0HRAaxfl4gKYw9kpGOtkrwezzU_biPYxV26-sUjXvPGx87WAZszqlIosXOJVux33eJD3V5bDcFD06Faze9OE5Segl4Tdmd0VZs73lt4PGXfF90QLCqZeUuNUUCkhRRRsP99SdW99Ghx0JncIQDpfX3fByce58jmKSCFWjcHy5qTPlryVI3KVow-XMLiguVmdbicCBGq-7im00hCmjH2-5HCuQnhHafNHUSZzZiHTg4KaTqvIMTfQIXs\", 4, 0)", "new EmuController(\"6003788660296-id_4dc09ff0612299683640305\", \"AQCvUWOfDiphu5NGe7r6dBna_IEvTbjrshIpxmOlMO3jwk650AHb_T03II0mnzLwpdy617kQMD8n8RIE_YqIE1hNxxoZL4M4ba8QiPz6h-u003c\/h4>\JW8WSPFBt1RSMeJQV7swF6HWeAm3Ew0fphxMwpdYDIu2fbEGLujVFCKwtMCzN6As6berB8z7iOoWdsAFulXLBLvHID0-Dn0_qCxF-AKl0b9s8cWBwF9fG1oI0r1TNQZGILLW8daCOkkjhpCUOHkXI6PFxyw5CXYLSmnVAxpvougwh7vt-NV3RWPuYnLN1QOvf07q2DRv-2wY1JUexmcWl6f5zquDJfEW3CxlluJ76eKZowfiGW-V-1M9K9whgfALkEjGDA-JM9P_lfXaukcmDDwAIHLFwG_7a9jNP4XmbLUyQEhUesxkImM5z7IAzt-HBIbtDfD8kHt50AG3nm3GEHv-yChqKMWqmcuzyYgmMGaXXKCd9Pb2a_pcF-QR_YIg2qgptFnn82D7Bb9Tedmce-FveNix9Ej7_fwr-IAncYwABNrs9zX34TkbLgvqhvH9RayLDXO7GnGWB_I4jorTbmNvpxf0rG8aXp3udXdNTEZAjmU3Yp1TOySAXY2Z5Ju6oYS51-tQ2SZIihYsa49TxQdSHet9vO4tjY_7rwT8Cou_TrmFWwZXuQTGwfUByP9Cl6wrUNhHeW3zbrB-BAxofxqcGQ44C7HPsvVTdkSOKhx60zaWaaBnDZ87QjEAgNJ-NjN8EqO_jMq3ig2Vn2CKzBhhQ\", 4, 0)", "new EmuController(\"6002985380734-id_4dc09ff06123a8641112115\", \"AQBkHx98vGQ8Bn2h8R42L-S1OQfGO1ksTR41Mds3V7wEwzKNgBG4H2o-EHRvRSd9SsIPGChah-NHU5Jt_wbtng06_Dw0U0WkxfBkFx374OINZj69o69sPYmoQZlY2xsClxS0T2t_h7zs9RzX4NpvYtSL6I3MALL0CsWS0KLv-CQHUF-IWpeNj6uGLG4efTFLBBMeQM0-Wr1IWYXU6oQZJRPwS7trOw4xW56wGBnhGPv1KRwr8ITU4NGUZlBKrUNRvx1SeyFn4MYNCrzXG0W_HxsWWv_ekTeDefvMF0gHZNDgcA07-FLEYxfCEzBL498OERPhoyBsmFE9fGbOY1EcO_LB_moqIncJF-TosooObw7f4BMZwHMxfGgju_UKndyeRq_l3pcTkSyjhbZY5-1sjojM8AI9VxCLdQms5QA7lvflmdPpwXS3b8UmCNfEtIy4iGED7yL7p1CKAKgJcO4jzmJ3Epk9tK38zy3Nv5yGB0-63dwjcvZMoTJMa545d2Vgs7J5_OiD6gA5fX4oB84m1dcI5e2G6AgzXAsWTUSuIGliPQr2oFjaz2mOzepyCvoatPjr1rtDkX_xNK9S27jXSuu9k0tiKCOkPsdccPO6235zCT0HeiPI0sHsUTpDmiFXHyFx0r_Kus5iCU5CjKjX1okSuKQL7WM5HTBvYRCAbPNthqa9oNDDNmwNG-Im7wNZHEw4ZZuXpqg4UolyUZAkY7dKBRvGmK0sSGSIjIISOq1e6zBdekf7OlZ5yLnCwhAI_5E\", 4, 0)"],
        "onafterload": ["new EmuTracker(\"6002939839588-id_4dc09ff0611f60c83869379\", false)", "new EmuTracker(\"6003087448525-id_4dc09ff0612184c51197177\", false)", "new EmuTracker(\"6003788660296-id_4dc09ff0612299683640305\", false)", "new EmuTracker(\"6002985380734-id_4dc09ff06123a8641112115\", false)"],
        "refresh_pagelets": ["c4dc09ff06275f0732488206"],
        "content": {
            "pagelet_ego_pane": "\u003cdiv id=\"c4dc09ff06275f0732488206\">\u003cdiv class=\"ego_column egoOrganicColumn\">\u003cdiv class=\"ego_section\">\u003cdiv class=\"uiHeader uiHeaderTopAndBottomBorder mbs uiSideHeader\">\u003cdiv class=\"clearfix uiHeaderTop\">\u003ca class=\"uiHeaderActions rfloat\" href=\"\/l.php?u=\u00252Ffind-friends\u00252Fbrowser\u00252F\u00253Fref\u00253Dpsa&amp;h=1ef37&amp;cb=3&amp;p=AQCicK3gLdJTaaW2xZUw3DWp7N89P5QwZvSEfn3y2vOqjXyzr60nDcHEPY7Y9x7LpK9-J5evLB7_Dwm9F4d0k5i9sQ-CXiH_GXc-toIfka4dUSK_\">See All\u003c\/a>\u003cdiv>\u003ch4 class=\"uiHeaderTitle\">People You May Know\u003c\/div>

2 个答案:

答案 0 :(得分:1)

GM脚本没有删除script节点,它只是“隐藏”它 - 它永远不会产生影响。

GM有可能实际删除script节点,但是,在节点运行之前不会发生这种情况。之后删除它不会停止操作,因为JS已经加载到内存中。

最简单的要做的是删除显示PYMK残骸的容器。
我不使用Facebook,但是从您的代码中可以看出容器可能具有id,“pagelet_ego_pane”。在这种情况下,您可以删除它:

var PYMK_Container  = document.getElementById ('pagelet_ego_pane');
if (PYMK_Container) PYMK_Container.parentNode.removeChild (PYMK_Container);

你也可以尝试删除烦人的功能,这可能是也可能是不可能的。使用new UIPagelet(\"c4dc09ff06275f0732488206\"代码设置函数。因此,如果您可以找到相应的功能,可以尝试删除它:

unsafeWindow.OffendingFunctionName = function() { return; }

如果可行,它可能会减少可能减慢该页面的JavaScript“流失”。

至于阻止你的名字出现在其他人的PYMK中,这是由Facebook服务器完成的,可能有他们拥有的用户设置,否则你将不得不向Facebook发送一封“措辞严厉的信件” ”。 ;)

答案 1 :(得分:0)

更简单的方法是添加隐藏违规节点的用户样式表,不需要javascript。

但是,如果你想要一个简单的方法,只需工作&#34;开箱即用&#34;隐藏“你可能知道的人”#34;框中,FB Purity浏览器插件(也可作为greasemonkey脚本提供)有一个隐藏PYMK框的选项,以及隐藏网站上大多数其他框/链接的选项。