Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
Last active October 11, 2021 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julianxhokaxhiu/f8a2dae96cd0d29277aa5912d0a07f5f to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/f8a2dae96cd0d29277aa5912d0a07f5f to your computer and use it in GitHub Desktop.
Purge all your Facebook Activity automatically, from your own Browser, using the new Facebook UI
/*
The MIT License (MIT)
Copyright (c) 2020 Julian Xhokaxhiu
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//==============================================================================
/*
HOW TO USE:
0a) Make sure you are using the new Facebook UI ( see https://about.fb.com/news/2020/05/the-new-facebook-com/ )
0b) Make sure your current language is set to "English (US)" ( change it here https://www.facebook.com/settings?tab=language&section=account&view )
1) Open your Facebook activity log page
( https://www.facebook.com/<YOUR_USERNAME>/allactivity )
2) OPTIONAL! Filter the activity category you want to purge
3) Open your Console ( CTRL+SHIFT+I or CMD+SHIFT+I )
4) Copy the following script, paste it in your own Console and press Enter
5) Enjoy
PLEASE NOTE: There are some activities which may throw an error on deletion.
If that happens, It suggested to delete that activity manually using the
https://mbasic.facebook.com/<YOUR_USERNAME>/allactivity URL.
Then you can refresh the new Facebook UI layout and try to run again
this script.
WHY:
I was simply bored to click left and right for each activity, and Facebook
did not help by providing a bulk delete option for certain categories.
So, here we are :) Sorry Facebook!
*/
//==============================================================================
var $$ = $;
setInterval(
function(){
$$('[aria-label="Action options"]').click()
$$('[data-testid="Keycommand_wrapper_ModalLayer"] div[role="menuitem"]:last-child').click()
},
250 // Set this at your own ratio, gowing lower is not suggested as Facebook may flag your profile to be a spam bot
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment