Skip to content

Instantly share code, notes, and snippets.

@dvygolov
Created November 1, 2022 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dvygolov/8fe13a503c78dbde84f6e1152395d681 to your computer and use it in GitHub Desktop.
Save dvygolov/8fe13a503c78dbde84f6e1152395d681 to your computer and use it in GitHub Desktop.
Turn OFF Facebook Support Notifications
let uid = require("CurrentUserInitialData").USER_ID;
let fb_lsd = require("LSD").token;
let dtsg = require("DTSGInitialData").token;
let body_variables = {"switch_state":"SWITCH_OFF"};
let body = {
"av":uid,
"__user":uid,
"__a":1,
"fb_dtsg":dtsg,
"lsd":fb_lsd,
"variables":JSON.stringify(body_variables),
"server_timestamps":true,
"doc_id":7629583210385434
};
let f = await fetch("https://www.facebook.com/api/graphql/", {
"credentials": "include",
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0",
"Accept": "*/*",
"Accept-Language": "ru,en-US;q=0.7,en;q=0.3",
"Content-Type": "application/x-www-form-urlencoded",
"Alt-Used": "www.facebook.com",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"Pragma": "no-cache",
"Cache-Control": "no-cache"
},
"referrer": "https://www.facebook.com/support",
"body": new URLSearchParams(body).toString(),
"method": "POST",
"mode": "cors"
});
let js = await f.json();
console.log(`Operation successfull:${js['data']['support_inbox_switch_show_notifications']}`);
alert("Support Notifications turned OFF!");
@dvygolov
Copy link
Author

dvygolov commented Nov 1, 2022

If you want to make it a bookmark, use this👇

javascript:(async()=>{let e=require("CurrentUserInitialData").USER_ID,t=require("LSD").token,o,a=await (await fetch("https://www.facebook.com/api/graphql/",{credentials:"include",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0",Accept:"*/*","Accept-Language":"ru,en-US;q=0.7,en;q=0.3","Content-Type":"application/x-www-form-urlencoded","Alt-Used":"www.facebook.com","Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin",Pragma:"no-cache","Cache-Control":"no-cache"},referrer:"https://www.facebook.com/support",body:new URLSearchParams({av:e,__user:e,__a:1,fb_dtsg:require("DTSGInitialData").token,lsd:t,variables:JSON.stringify({switch_state:"SWITCH_OFF"}),server_timestamps:!0,doc_id:7629583210385434}).toString(),method:"POST",mode:"cors"})).json();console.log("Operation successfull:"+a.data.support_inbox_switch_show_notifications),alert("Support Notifications turned OFF!")})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment