Skip to content

Commit

Permalink
🐛 Fix popup gets overlapped on some websites (#8)
Browse files Browse the repository at this point in the history
* Add types chrome and jquery for fixing warning from IDE

* Remove unnecessary lines

* Fix deprecated click binding

* Rename prettier script

* Omit the comment

* Fix popup gets overlapped on some websites
  • Loading branch information
rayspock authored Jan 28, 2024
1 parent 17cc7c1 commit bdccccb
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ default: build
build:
@echo "*** CleanCaptain: Creating web store package"
@mkdir -p $(BUILD_DIR)
# Zip an archive without including the parent directory
@# Zip an archive without including the parent directory
@cd $(basename src/)/ && zip ../$(BUILD_DIR)/$(NAME).zip -qr *
@echo "*** CleanCaptain: Package created"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "clean-captain",
"author": "rayspock",
"scripts": {
"prettier": "prettier --write \"**/*.js\""
"format": "prettier --write \"**/*.js\""
},
"devDependencies": {
"@types/chrome": "^0.0.259",
"@types/jquery": "^3.5.29",
"prettier": "^3.2.4"
}
}
3 changes: 3 additions & 0 deletions src/css/content.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.my-swal {
z-index: 100001;
}
5 changes: 0 additions & 5 deletions src/js/background.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

"use strict";
import * as helper from "./helper.js";

chrome.contextMenus.create({
Expand Down
12 changes: 11 additions & 1 deletion src/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Yes, delete it!",
customClass: {
container: "my-swal",
},
}).then((result) => {
if (result.value) {
chrome.runtime.sendMessage(
Expand All @@ -35,7 +38,14 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
history.go(0);
} else {
if (!data.noPrompt) {
Swal.fire("Deleted!", "Your cookies has been deleted.", "success");
Swal.fire({
title: "Deleted!",
text: "Your cookies has been deleted.",
icon: "success",
customClass: {
container: "my-swal",
},
});
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ chrome.storage.sync.get("noPrompt", (data) => {
});
});

$("#clearData").click(() => {
$("#clearData").on("click", () => {
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
helper.notifyClearData(chrome, tabs[0]);
});
Expand Down
8 changes: 6 additions & 2 deletions src/lib/sweetalert2.all.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Clean Captain",
"version": "1.2.0",
"version": "1.2.1",
"description": "Clear cookies from visiting websites",
"icons": {
"16": "img/icon16.png",
Expand Down Expand Up @@ -33,6 +33,9 @@
"http://*/*",
"https://*/*"
],
"css": [
"css/content.css"
],
"js": [
"lib/sweetalert2.all.min.js",
"js/content.js"
Expand Down
37 changes: 37 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
# yarn lockfile v1


"@types/chrome@^0.0.259":
version "0.0.259"
resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.259.tgz#5e55941b3f4067d088c0ad81c094733128db0f0a"
integrity sha512-WP1HsLqKgoUwR/4dYiTfmOSUG5B05+xrPLbqboO15nuaUC+aBYxwB9ixVyLPYY9D+vocJK9rzH5g1lpqVrJqhg==
dependencies:
"@types/filesystem" "*"
"@types/har-format" "*"

"@types/filesystem@*":
version "0.0.35"
resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.35.tgz#6d6766626083e2b397c09bdc57092827120db11d"
integrity sha512-1eKvCaIBdrD2mmMgy5dwh564rVvfEhZTWVQQGRNn0Nt4ZEnJ0C8oSUCzvMKRA4lGde5oEVo+q2MrTTbV/GHDCQ==
dependencies:
"@types/filewriter" "*"

"@types/filewriter@*":
version "0.0.32"
resolved "https://registry.yarnpkg.com/@types/filewriter/-/filewriter-0.0.32.tgz#3cf7e0f870e54e60ed1bbd9280fa24a9444d3b48"
integrity sha512-Kpi2GXQyYJdjL8mFclL1eDgihn1SIzorMZjD94kdPZh9E4VxGOeyjPxi5LpsM4Zku7P0reqegZTt2GxhmA9VBg==

"@types/har-format@*":
version "1.2.15"
resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.15.tgz#f352493638c2f89d706438a19a9eb300b493b506"
integrity sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==

"@types/jquery@^3.5.29":
version "3.5.29"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.29.tgz#3c06a1f519cd5fc3a7a108971436c00685b5dcea"
integrity sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==
dependencies:
"@types/sizzle" "*"

"@types/sizzle@*":
version "2.3.8"
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.8.tgz#518609aefb797da19bf222feb199e8f653ff7627"
integrity sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==

prettier@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283"
Expand Down

0 comments on commit bdccccb

Please sign in to comment.