Skip to content

Commit

Permalink
Merge pull request #1 from cloudsteak/feat-1.1
Browse files Browse the repository at this point in the history
Version 1.1
  • Loading branch information
the1bit authored Apr 2, 2024
2 parents 42ef280 + 25f71a7 commit f07e8d7
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 8 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

Swift Cookie Wipe extension for Chrome browser

## Release Notes

You can find the release notes for the extension [here](./ReleaseNotes.md)

## Installation

Expand All @@ -21,7 +24,7 @@ Swift Cookie Wipe extension for Chrome browser

## License

[Lisense](./LICENSE)
[License](./LICENSE)


## Privacy Policy
Expand Down
14 changes: 14 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SwiftWipe Release Notes

## Version 1.1

- Confirmation dialog added to the "Clear Site Data" button
- Format button color


## Version 1.0

- Initial release
- Added "Clear Site Data" button to delete all cookies from the current website
- Multilingual support: English, Hungarian

12 changes: 12 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
},
"clearDataButton": {
"message": "Clear Site Data"
},
"confirmationMessage" : {
"message": "Are you sure you want to delete cookies for this site?"
},
"clearSuccess":{
"message": "Cookies has been deleted successfully"
},
"clearFailure": {
"message": "An error occurred while deleting"
},
"clearAbort": {
"message": "Deletion aborted"
}
}

13 changes: 12 additions & 1 deletion _locales/hu/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
},
"clearDataButton": {
"message": "Weboldal adatainak törlése"
},
"confirmationMessage" : {
"message": "Biztosan törölni szeretné az oldalhoz tartozó sütiket?"
},
"clearSuccess":{
"message": "Sütik sikeresen törölve"
},
"clearFailure": {
"message": "Hiba történt a törlés során!"
},
"clearAbort": {
"message": "A törlés megszakítva."
}

}
1 change: 0 additions & 1 deletion background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
console.log("Üzenet érkezett a popup-tól:", request);
if (request.action === "clearData") {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
const tab = tabs[0];
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.0",
"version": "1.1",
"default_locale": "en",
"permissions": ["cookies", "activeTab", "scripting"],
"host_permissions": ["<all_urls>"],
Expand Down
23 changes: 20 additions & 3 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<html>

<head>
<title>ClearData</title>
<title>SwiftWipe</title>
<link rel="stylesheet" href="css/all.min.css">
<style>
#swiftBody {
width: 250px !important;
text-align: center;
border-radius: 10px;
vertical-align: top;
}

#descriptionText {
Expand All @@ -18,14 +19,30 @@
font-size: 20px;
font-weight: bold;
}

#clearData{
height: 40px;
padding-left: 20px;
padding-right: 20px;
font-size: 16px;
border-radius: 5px;
border: none;
background-color: cornflowerblue;
color: white;
font-weight: 600;
}

#clearData:hover{
background-color: crimson;
}
</style>
</head>

<body>
<div id="swiftBody">
<img src="./images/icon48.png" alt="logo">
<p><span id="extensionTitle">Swift Wipe</span>&nbsp;(<a href="https://github.com/cloudsteak/SwiftWipe" target="_blank"><i class="fa-solid fa-circle-question"></i></a>)</p>
<button id="clearData"><i class="fa-solid fa-trash"></i>&nbsp;&nbsp;<span data-i18n="clearDataButton"></span></button>
<p><span id="extensionTitle">Swift Wipe&nbsp;<span id="extensionVersion"></span>&nbsp;(<a href="https://github.com/cloudsteak/SwiftWipe" target="_blank"><i class="fa-solid fa-circle-question"></i></a>)</p>
<button id="clearData"><i class="fa-solid fa-trash"></i>&nbsp; &nbsp;&nbsp;<span data-i18n="clearDataButton"></span></button>
<script src="popup.js"></script>
<p>
<label id="descriptionText" data-i18n="extensionDescription"></label>
Expand Down
13 changes: 12 additions & 1 deletion popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
document.addEventListener('DOMContentLoaded', function () {
// Version
var manifest = chrome.runtime.getManifest();
document.getElementById('extensionVersion').textContent = manifest.version;

// Translation
document.querySelectorAll('[data-i18n]').forEach(function (elem) {
let msg = elem.getAttribute('data-i18n');
Expand All @@ -7,7 +11,14 @@ document.addEventListener('DOMContentLoaded', function () {

// Event
document.getElementById('clearData').addEventListener('click', function () {
chrome.runtime.sendMessage({ action: "clearData" });
var confirmAction = confirm(chrome.i18n.getMessage("confirmationMessage"));
if (confirmAction) {
chrome.runtime.sendMessage({ action: "clearData" }, function (response) {
alert(chrome.i18n.getMessage("clearSuccess"));
});
} else {
alert(chrome.i18n.getMessage("clearAbort"));
}
});
});

0 comments on commit f07e8d7

Please sign in to comment.