@@ -10,25 +10,34 @@ export default {
1010 } ,
1111 whiteList : [ "https://www.facebook.com/*" ] ,
1212
13- onDocumentIdle : function ( ) {
14- [
15- ...Array . from ( document . querySelectorAll ( "[role='feed'], [role='main']" ) ) ,
16- document . querySelector ( "#watch_feed" ) ,
17- document . querySelector ( "#ssrb_stories_start" ) ?. parentElement ,
18- document . querySelector ( "#ssrb_feed_start" ) ?. parentElement ,
19- ] . forEach ( ( el ) => {
20- if ( el ) {
21- el . style . display = "none" ;
22- } else console . log ( "ERROR: Cannot find element" ) ;
23- } ) ;
13+ onDocumentStart : function ( ) {
14+ UsefulScriptGlobalWebpageContext . onElementsVisible (
15+ "[role='feed'], [role='main']" ,
16+ ( nodes ) =>
17+ Array . from ( nodes ) . forEach ( ( node ) => ( node . style . display = "none" ) ) ,
18+ true
19+ ) ;
2420 } ,
2521
26- onClickContentScript : async function ( ) {
22+ // onDocumentEnd: function () {
23+ // [
24+ // ...Array.from(document.querySelectorAll("[role='feed'], [role='main']")),
25+ // document.querySelector("#watch_feed"),
26+ // document.querySelector("#ssrb_stories_start")?.parentElement,
27+ // document.querySelector("#ssrb_feed_start")?.parentElement,
28+ // ].forEach((el) => {
29+ // if (el) {
30+ // el.style.display = "none";
31+ // } else console.log("ERROR: Cannot find element");
32+ // });
33+ // },
34+
35+ onClick : async function ( ) {
2736 [
2837 ...Array . from ( document . querySelectorAll ( "[role='feed'], [role='main']" ) ) ,
29- document . querySelector ( "#watch_feed" ) ,
30- document . querySelector ( "#ssrb_stories_start" ) ?. parentElement ,
31- document . querySelector ( "#ssrb_feed_start" ) ?. parentElement ,
38+ // document.querySelector("#watch_feed"),
39+ // document.querySelector("#ssrb_stories_start")?.parentElement,
40+ // document.querySelector("#ssrb_feed_start")?.parentElement,
3241 ] . forEach ( ( el ) => {
3342 if ( el ) {
3443 el . style . display = el . style . display === "none" ? "" : "none" ;
0 commit comments