Skip to content

Commit

Permalink
refactor: docs and minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindpunk committed Oct 6, 2024
1 parent 2ccc6f4 commit 91f1ff6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# url-switcher

This extension allows user to switch between google accounts for Gmail, Google Drive, Google Calendar etc. in a single click.
An extension that allows user to quickly switch between Google accounts for Gmail, Drive, Calendar etc. with a single click.

## Supported Domains

Expand Down
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://json.schemastore.org/chrome-manifest.json",
"manifest_version": 3,
"version": "1.0",
"version": "1.0.0",
"name": "url-switcher",
"description": "A minimum extension template. This template includes a manifest file.",
"author": "Your Name",
"description": "An extension that allows user to quickly switch between Google accounts for Gmail, Drive, Calendar etc. with a single click.",
"author": "arvindpunk",
"background": {
"chrome:service_worker": "src/main.ts",
"firefox:scripts": ["src/main.ts"]
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"private": true,
"name": "url-switcher",
"description": "An Extension.js example.",
"description": "An extension that allows user to quickly switch between Google accounts for Gmail, Drive, Calendar etc. with a single click.",
"version": "1.0.0",
"author": {
"name": "Your Name",
"email": "[email protected]",
"url": "https://yourwebsite.com"
"name": "arvindpunk",
"url": "https://arvindpunk.dev"
},
"license": "MIT",
"devDependencies": {
Expand All @@ -18,6 +17,7 @@
"scripts": {
"dev": "extension dev -b firefox",
"start": "extension start",
"build": "extension build --polyfill true --browser firefox,chrome"
"build": "extension build --polyfill true --browser firefox,chrome",
"publish": "extension build --zip true --polyfill true --browser firefox,chrome"
}
}
29 changes: 0 additions & 29 deletions src/conditions.ts

This file was deleted.

6 changes: 2 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { stringIncrement } from "./string-utils";
import browser from "webextension-polyfill";

console.log(browser.action);

browser.action.onClicked.addListener(function (tab) {
browser.action.onClicked.addListener((tab: browser.Tabs.Tab) => {
console.log(tab);
if (typeof tab.url === "undefined") return;
if (typeof tab.id === "undefined") return;
Expand All @@ -13,7 +11,7 @@ browser.action.onClicked.addListener(function (tab) {
browser.tabs.update(tab.id, { url: updatedUrl });
});

const getTransformedURL = (currentUrl: string) => {
const getTransformedURL = (currentUrl: string): string => {
const url = new URL(currentUrl);
switch (url.host) {
// path params
Expand Down
2 changes: 1 addition & 1 deletion src/string-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const stringIncrement = (numberString: string) => {
export const stringIncrement = (numberString: string): string => {
try {
return (parseInt(numberString) + 1).toString();
} catch (error) {
Expand Down

0 comments on commit 91f1ff6

Please sign in to comment.