Giter Site home page Giter Site logo

tebay9699 / delete-fb-messages Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mdunham/delete-fb-messages

0.0 0.0 0.0 12 KB

JavaScript utility that allows you to auto delete all your Facebook messages. Adds a feature to Facebook that should have already been added.

JavaScript 100.00%

delete-fb-messages's Introduction

Auto Delete All Facebook Messages

JavaScript utility that allows you to auto delete all your Facebook messages. Adds a feature to Facebook that should have already been added.

Usage Instructions

The easiest way to use this code is by saving it as a bookmark on your browser's bookmark bar. GitHub doesn't allow javascript links to be on readme pages so click here and follow the simple one-step instruction.

If that doesn't work try the manual method.

How to use the bookmark button

After you have the delete button in your bookmarks using the button is easy. Simply log in to your Facebook and go to your "view all messages" page. Once the page loads all you have to do is click the bookmark you just created "Delete FB Messages". Stay on the messages page until all your messages are deleted. Once a message is deleted, it's gone. There is no undelete.

To stop the delete process simply leave the messages page or just hit refresh.


Alternatively, you can create the bookmark manually:

Instructions for creating the bookmark:

  • Press Control+D on your keyboard, this will open the "create a new bookmark" window.
  • Title it "Delete FB Messages"
  • Then click the "Edit" button, because the URL of the bookmark will need to be changed.
  • Now delete everything that is in the URL field and replace it with the following:

javascript:!function(e){var t=function(){null!==e('div[aria-label="Conversation actions"]')?(e('div[aria-label="Conversation actions"]').click(),setTimeout(o,200)):console.log("There are no messages to delete")},o=function(){for(var e=document.evaluate('//span[text()="Delete"]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),t=0;t<e.snapshotLength;t++)e.snapshotItem(t).click();setTimeout(n,200)},n=function(){e('em[data-intl-translation="Delete"]').parentNode.click(),null!==e('div[aria-label="Conversation actions"]')?setTimeout(t,600):console.log("No more messages")};console.log("Deleting Facebook Messages"),t()}(function(e){return document.querySelector(e)});

The code above is just a minified version of the delete-fb-messages.js file, but make sure the URL of the bookmark is exactly the code above. No http:// or www.

For faster access make sure to save it to your "bookmark bar" so it is always visible and ready to clean up your inbox.

An example of what your bookmark should look like before you actually save the new bookmark:

Example Bookmark


Running it with-out a bookmark

You can also run this code using your web browser's console. First navigate to your Facebook messages page and then press Control+Shift+i on your keyboard. This will open your developer tools once it opens if you do not see the console which should be at the bottom of the window press the Escape key on your keyboard. Now you should see the console now simply copy all the code from the gist and paste it into the console and hit enter.

Here is what it should look like:

Example Bookmark

After you've pasted the code into the console don't forget to press the Enter key on your keyboard to run the code. When it runs the console will say "Deleting all Facebook messages - By: Matthew Dunham" this tells you that it is working, and your messages should start deleting. When the script has finished deleting all your messages it will say "No more messages to delete" in the console.

You can stop the delete process at any time by closing your browser or simply refreshing the page or even just navigate away from your Facebook messages page.


Security Info

If you see a warning that says Stop in all red don't worry it's just a precaution to stop people from accidentally XSS attacking themselves. This code does not make any external calls, and only contains 29 lines of code. If you are not comfortable running things from your web console then don't! Always read and know what any code will do before running anything in console. Regardless if you're on Facebook or some other site.

delete-fb-messages's People

Contributors

mdunham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.