Skip to content

Commit d116b9c

Browse files
Add files via upload
Works, but need's to be worked on. I want it to work by clicking 1 button only.
0 parents  commit d116b9c

9 files changed

+141
-0
lines changed

128x128.png

25.3 KB
Loading

16x16.png

18.2 KB
Loading

32x32.png

19.1 KB
Loading

48x48.png

20.2 KB
Loading

icon.png

120 KB
Loading

manifest.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"update_url": "https://clients2.google.com/service/update2/crx",
3+
4+
"manifest_version": 2,
5+
6+
"name": "Metalete",
7+
"description": "Delete all conversations in messenger",
8+
"version": "1.1",
9+
"browser_action": {
10+
"default_icon": "icon.png",
11+
"default_popup": "popup.html"
12+
},
13+
"icons": {
14+
15+
"16": "16x16.png",
16+
"32": "32x32.png",
17+
"48": "48x48.png",
18+
"128": "128x128.png"
19+
},
20+
"permissions": [
21+
"activeTab","tabs"
22+
23+
],
24+
25+
"web_accessible_resources": ["script.js"]
26+
}

popup.html

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Metalete - Messenger conversations deleter</title>
5+
6+
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
7+
8+
<style>
9+
body {
10+
background-color: #ffffff;
11+
color:rgb(0, 0, 0);
12+
font-family: 'Lato';
13+
padding: 0px;
14+
}
15+
.btn:hover, .btn:active {
16+
color: rgb(0, 0, 0);
17+
background: rgb(185, 255, 220);
18+
}
19+
20+
.btn {
21+
border: none;
22+
border-radius: 30px;
23+
font-family: inherit;
24+
font-size: inherit;
25+
color: inherit;
26+
background-color:rgb(194, 194, 194);
27+
cursor: pointer;
28+
padding: 25px 80px;
29+
display: inline-block;
30+
margin: 15px 30px;
31+
text-transform: uppercase;
32+
letter-spacing: 1px;
33+
font-weight: 700;
34+
outline: none;
35+
position: relative;
36+
-webkit-transition: all 0.3s;
37+
-moz-transition: all 0.3s;
38+
transition: all 0.3s;
39+
}.btn {
40+
color: rgb(0, 0, 0);
41+
width: 300px;
42+
height:50px;
43+
padding: 15px;
44+
margin: 10px;
45+
text-align: left;
46+
}
47+
.bar{
48+
background-color: rgb(194, 194, 194);
49+
display: flex;
50+
flex-direction: column;
51+
justify-content: center;
52+
padding: 0px;
53+
height: 80px;
54+
margin-bottom: 10px;
55+
}
56+
h1{
57+
color:rgb(29, 29, 29);
58+
padding: 0px;
59+
margin: 0px;
60+
}
61+
</style>
62+
</head>
63+
<body><center>
64+
<div class="bar"><h1>Metalete</h1>Messenger conversations deleter</div>
65+
<button id="openMessenger" class="btn">Step 1. Open Messenger</button>
66+
<button id="removeConversations" class="btn">Step 2. Remove all conversations</button></center>
67+
<p align="center" style="color:red;">Wait for conversations to be deleted, don't change tabs</p>
68+
<script src="popup.js"></script>
69+
</body>
70+
</html>

popup.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
document.addEventListener('DOMContentLoaded', function() {
2+
var checkPageButton = document.getElementById('removeConversations');
3+
var theTab;
4+
checkPageButton.addEventListener('click', function() {
5+
chrome.windows.getCurrent(function (currentWindow) {
6+
chrome.tabs.query({ active: true, windowId: currentWindow.id }, function (activeTabs) {
7+
activeTabs.map(function (tab) {
8+
theTab = tab.id;
9+
});
10+
});
11+
});
12+
chrome.tabs.executeScript(theTab, { file: 'script.js', allFrames: false });
13+
}, false);
14+
var checkPageButton2 = document.getElementById('openMessenger');
15+
checkPageButton2.addEventListener('click', function() {
16+
chrome.windows.create({url: "https://www.messenger.com/t/"});
17+
}, false);
18+
}, false);

script.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
(function($){
2+
// while (null !== $('div[role="gridcell"]')){
3+
var
4+
step1 = function(){
5+
$('div[role="gridcell"]').click();
6+
setTimeout(step2, 500);},
7+
8+
step2 = function(){
9+
$('div[role="gridcell"]').click();
10+
setTimeout(step3, 500);},
11+
12+
step3 = function(){
13+
$('div[aria-label="Menu"]').click();
14+
setTimeout(step4, 300);},
15+
16+
step4 = function(){
17+
var elements = document.evaluate('//div[@role="menu"]//span[contains(text(),"Delete chat")]', document, null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
18+
for (var i = 0; i < elements.snapshotLength; i++) {
19+
elements.snapshotItem(i).click();}
20+
setTimeout(step5, 500);},
21+
22+
step5 = function(){
23+
$('div[aria-label="Delete chat"]').click();
24+
setTimeout(step1, 300);};
25+
step1();
26+
})(function(selector){ return document.querySelector(selector);
27+
});

0 commit comments

Comments
 (0)