From 98b760c76ae4422030f6ef2ef66fbb02650d8889 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Tue, 3 Mar 2026 23:19:45 +0530 Subject: [PATCH] chore: remove unused files and clean up project structure --- background/index.js | 22 ------------- common/settings.js | 5 --- common/settings.test.js | 10 ------ common/storage.js | 9 ------ common/storage.test.js | 42 ------------------------- content_scripts/index.js | 13 -------- icons/icon128.png | Bin 897 -> 0 bytes icons/icon16.png | Bin 300 -> 0 bytes icons/icon48.png | Bin 552 -> 0 bytes manifest.json | 56 --------------------------------- newtab/newtab.html | 11 ------- newtab/scripts/index.js | 13 -------- newtab/styles/_page.scss | 10 ------ newtab/styles/_variables.scss | 3 -- newtab/styles/newtab.scss | 2 -- options/options.html | 31 ------------------ options/scripts/index.js | 21 ------------- options/styles/_page.scss | 10 ------ options/styles/_variables.scss | 3 -- options/styles/options.scss | 2 -- popup/popup.html | 11 ------- popup/scripts/index.js | 13 -------- popup/styles/_page.scss | 10 ------ popup/styles/_variables.scss | 3 -- popup/styles/popup.scss | 2 -- 25 files changed, 302 deletions(-) delete mode 100644 background/index.js delete mode 100644 common/settings.js delete mode 100644 common/settings.test.js delete mode 100644 common/storage.js delete mode 100644 common/storage.test.js delete mode 100644 content_scripts/index.js delete mode 100644 icons/icon128.png delete mode 100644 icons/icon16.png delete mode 100644 icons/icon48.png delete mode 100644 manifest.json delete mode 100644 newtab/newtab.html delete mode 100644 newtab/scripts/index.js delete mode 100644 newtab/styles/_page.scss delete mode 100644 newtab/styles/_variables.scss delete mode 100644 newtab/styles/newtab.scss delete mode 100644 options/options.html delete mode 100644 options/scripts/index.js delete mode 100644 options/styles/_page.scss delete mode 100644 options/styles/_variables.scss delete mode 100644 options/styles/options.scss delete mode 100644 popup/popup.html delete mode 100644 popup/scripts/index.js delete mode 100644 popup/styles/_page.scss delete mode 100644 popup/styles/_variables.scss delete mode 100644 popup/styles/popup.scss diff --git a/background/index.js b/background/index.js deleted file mode 100644 index 63caf8d..0000000 --- a/background/index.js +++ /dev/null @@ -1,22 +0,0 @@ -chrome.runtime.onInstalled.addListener(function (object) { - if (object.reason === chrome.runtime.OnInstalledReason.INSTALL) { - chrome.tabs.create({ url: "https://clydedsouza.net" }); - } -}); - -chrome.commands.onCommand.addListener((command) => { - if(command === 'turn-on') { - chrome.action.setBadgeText({ text: 'ON' }); - chrome.action.setBadgeBackgroundColor({ color: 'green' }); - } - if(command === 'turn-off') { - chrome.action.setBadgeText({ text: 'OFF' }); - chrome.action.setBadgeBackgroundColor({ color: 'red' }); - } -}); - -chrome.omnibox.onInputEntered.addListener((text) => { - chrome.tabs.create({ url: 'https://facebook.com/' + encodeURIComponent(text) }); - chrome.tabs.create({ url: 'https://twitter.com/' + encodeURIComponent(text) }); - chrome.tabs.create({ url: 'https://instagram.com/' + encodeURIComponent(text) }); -}); \ No newline at end of file diff --git a/common/settings.js b/common/settings.js deleted file mode 100644 index ba9904f..0000000 --- a/common/settings.js +++ /dev/null @@ -1,5 +0,0 @@ -export const CHROME_SYNC_STORAGE_KEY = "chrome-extension-template"; - -export const PRESET_CONFIGURATION = { - "storageValue": "https://clydedsouza.net", -}; diff --git a/common/settings.test.js b/common/settings.test.js deleted file mode 100644 index aad8a77..0000000 --- a/common/settings.test.js +++ /dev/null @@ -1,10 +0,0 @@ -import * as settingsModule from "./settings"; - -describe("settings", () => { - test("has a preset configuration key", () => { - const presetConfig = settingsModule.PRESET_CONFIGURATION; - const keys = Object.keys(presetConfig); - expect(keys.length).toBe(1); - expect(presetConfig["storageValue"]).toBe("https://clydedsouza.net"); - }); -}); diff --git a/common/storage.js b/common/storage.js deleted file mode 100644 index 239aa85..0000000 --- a/common/storage.js +++ /dev/null @@ -1,9 +0,0 @@ -export const getStorage = (componentKey, callback) => { - chrome.storage.sync.get([componentKey], function(result) { - callback(result[componentKey]); - }); -}; - -export const setStorage = (componentKey, value) => { - chrome.storage.sync.set({[componentKey]: value}); -}; \ No newline at end of file diff --git a/common/storage.test.js b/common/storage.test.js deleted file mode 100644 index 656bf98..0000000 --- a/common/storage.test.js +++ /dev/null @@ -1,42 +0,0 @@ -import * as storageModule from "./storage"; - -const get = jest.fn(); -const set = jest.fn(); - -global.chrome = { - storage: { - sync: { - set, - get - } - } -}; - -const chromeGetStorageSpy = jest.spyOn(chrome.storage.sync, 'get'); -const chromeSetStorageSpy = jest.spyOn(chrome.storage.sync, 'set'); - -describe("storage → getStorage", () => { - beforeEach(() => { - jest.resetAllMocks(); - }); - - test("chrome get storage api method called", () => { - const getCallback = jest.fn(); - - storageModule.getStorage("Test", getCallback); - - expect(chromeGetStorageSpy).toHaveBeenCalledWith(["Test"], expect.any(Function)); - }); -}); - -describe("storage → setStorage", () => { - beforeEach(() => { - jest.resetAllMocks(); - }); - - test("chrome set storage api method called", () => { - storageModule.setStorage("Test", "Value"); - - expect(chromeSetStorageSpy).toHaveBeenCalledWith({["Test"]: "Value"}); - }); -}); diff --git a/content_scripts/index.js b/content_scripts/index.js deleted file mode 100644 index b50340f..0000000 --- a/content_scripts/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { getStorage } from "../common/storage"; -import { CHROME_SYNC_STORAGE_KEY, PRESET_CONFIGURATION } from "../common/settings"; - -function loadAndDisplayStorageValue(result) { - const savedConfiguration = result || PRESET_CONFIGURATION; - const storageValue = savedConfiguration["storageValue"]; - console.info("Storage value is", storageValue); -} - -window.onload = function() { - console.info("Content script loaded"); - getStorage(CHROME_SYNC_STORAGE_KEY, loadAndDisplayStorageValue); -} diff --git a/icons/icon128.png b/icons/icon128.png deleted file mode 100644 index ef76857dee7727c1eeafba83b1669ed72d3344e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 897 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSoCO|{#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&di49sGlE{-7;jBoGm%@PTearjuD!quD^v~sDY zu29F^wTAu+=H7bAeWb&#G2sj6n=9w`G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g=tN@Jx|bHh&Mn1 z=LLTbw_Sjz9B6d4abd!f0H+U4#1T478I?v`0Y8;&Mq@k8O2p7s!2Pp|lEzDjO}*9) zje`*&jS(P?^>Exf*l&!4vLCp7{QI%-Yg6w^7>cbGWs|G6-|t68S@T>LfnafO#bGgR z_XF)?e&B<6EB}8TzCnW$V3JrGBS0EaH@ds&Z&!jWXYHOqR6r&LUvMXbdsPc*VF7y= q!+$u8RuWfg_PWvuQ%0rHUcfgR&~G}!OXS-C0000 - - - Chrome Extension Template New Tab - - - - - - This is the customized new tab page inserted by Chrome Extension Template - \ No newline at end of file diff --git a/newtab/scripts/index.js b/newtab/scripts/index.js deleted file mode 100644 index 807233e..0000000 --- a/newtab/scripts/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { getStorage } from "../../common/storage"; -import { PRESET_CONFIGURATION, CHROME_SYNC_STORAGE_KEY } from "../../common/settings"; - -function loadConfiguration(result) { - const savedConfiguration = result || PRESET_CONFIGURATION; - const storageValue = savedConfiguration["storageValue"]; - console.info("Storage value", storageValue); -} - -window.onload = function() { - console.info("New Tab script loaded"); - getStorage(CHROME_SYNC_STORAGE_KEY, loadConfiguration); -}; diff --git a/newtab/styles/_page.scss b/newtab/styles/_page.scss deleted file mode 100644 index ac069b7..0000000 --- a/newtab/styles/_page.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "./variables"; - -body { - background-color: $light-gray; - color: $dark-gray; - font: { - family: $font-family; - size: 16px; - } -} diff --git a/newtab/styles/_variables.scss b/newtab/styles/_variables.scss deleted file mode 100644 index 30d3fb5..0000000 --- a/newtab/styles/_variables.scss +++ /dev/null @@ -1,3 +0,0 @@ -$dark-gray: #5600eb; -$light-gray: #b7d6ff; -$font-family: -apple-system, BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif; diff --git a/newtab/styles/newtab.scss b/newtab/styles/newtab.scss deleted file mode 100644 index 819ef8e..0000000 --- a/newtab/styles/newtab.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "./variables"; -@import "./page"; \ No newline at end of file diff --git a/options/options.html b/options/options.html deleted file mode 100644 index da94d7e..0000000 --- a/options/options.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Chrome Extension Template - - - - - - -
-
- -
- -
-
- - - \ No newline at end of file diff --git a/options/scripts/index.js b/options/scripts/index.js deleted file mode 100644 index 1495c66..0000000 --- a/options/scripts/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import { getStorage,setStorage } from "../../common/storage"; -import { PRESET_CONFIGURATION, CHROME_SYNC_STORAGE_KEY } from "../../common/settings"; - -function saveConfiguration() { - const updatedConfiguration = { - storageValue: document.getElementById("storageValue").value - }; - setStorage(CHROME_SYNC_STORAGE_KEY, updatedConfiguration); -} - -function loadConfiguration(result) { - const savedConfiguration = result || PRESET_CONFIGURATION; - const storageValue = savedConfiguration["storageValue"]; - document.getElementById("storageValue").value = storageValue; -} - -window.onload = function() { - console.info("Options script loaded"); - document.getElementById("SaveConfiguration").addEventListener("click", saveConfiguration); - getStorage(CHROME_SYNC_STORAGE_KEY, loadConfiguration); -}; diff --git a/options/styles/_page.scss b/options/styles/_page.scss deleted file mode 100644 index ac069b7..0000000 --- a/options/styles/_page.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "./variables"; - -body { - background-color: $light-gray; - color: $dark-gray; - font: { - family: $font-family; - size: 16px; - } -} diff --git a/options/styles/_variables.scss b/options/styles/_variables.scss deleted file mode 100644 index 86ac092..0000000 --- a/options/styles/_variables.scss +++ /dev/null @@ -1,3 +0,0 @@ -$dark-gray: #6B6B6B; -$light-gray: #F4F5F7; -$font-family: -apple-system, BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif; diff --git a/options/styles/options.scss b/options/styles/options.scss deleted file mode 100644 index 819ef8e..0000000 --- a/options/styles/options.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "./variables"; -@import "./page"; \ No newline at end of file diff --git a/popup/popup.html b/popup/popup.html deleted file mode 100644 index 6b3ec65..0000000 --- a/popup/popup.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Chrome Extension Template Popup - - - - - - This is a Chrome Extension popup window - \ No newline at end of file diff --git a/popup/scripts/index.js b/popup/scripts/index.js deleted file mode 100644 index 0531a38..0000000 --- a/popup/scripts/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { getStorage } from "../../common/storage"; -import { PRESET_CONFIGURATION, CHROME_SYNC_STORAGE_KEY } from "../../common/settings"; - -function loadConfiguration(result) { - const savedConfiguration = result || PRESET_CONFIGURATION; - const storageValue = savedConfiguration["storageValue"]; - console.info("Storage value", storageValue); -} - -window.onload = function() { - console.info("Popup script loaded"); - getStorage(CHROME_SYNC_STORAGE_KEY, loadConfiguration); -}; diff --git a/popup/styles/_page.scss b/popup/styles/_page.scss deleted file mode 100644 index ac069b7..0000000 --- a/popup/styles/_page.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "./variables"; - -body { - background-color: $light-gray; - color: $dark-gray; - font: { - family: $font-family; - size: 16px; - } -} diff --git a/popup/styles/_variables.scss b/popup/styles/_variables.scss deleted file mode 100644 index 8bcdc70..0000000 --- a/popup/styles/_variables.scss +++ /dev/null @@ -1,3 +0,0 @@ -$dark-gray: #830000; -$light-gray: #fdffd0; -$font-family: -apple-system, BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif; diff --git a/popup/styles/popup.scss b/popup/styles/popup.scss deleted file mode 100644 index 819ef8e..0000000 --- a/popup/styles/popup.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "./variables"; -@import "./page"; \ No newline at end of file