Skip to content

Commit

Permalink
fix chrome extension notifications and uptick version
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonstreator committed Jan 27, 2025
1 parent 9c3d8f1 commit 02e3420
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @crypt.fyi/cli

<a href="https://crypt.fyi" target="_blank">
<img src="https://crypt.fyi/logo-light.svg" style="width: 100px;" alt="logo" />
<img src="https://crypt.fyi/logo-dark.svg" style="width: 100px;" alt="logo" />
</a>

CLI for interacting with the [crypt.fyi](https://crypt.fyi) API.
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@crypt.fyi/cli",
"version": "0.0.6",
"version": "0.0.7",
"type": "module",
"bin": {
"cfyi": "./dist/index.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@crypt.fyi/core",
"version": "0.0.6",
"version": "0.0.7",
"license": "Apache-2.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@crypt.fyi/extension",
"version": "0.0.6",
"version": "0.0.7",
"private": true,
"type": "module",
"scripts": {
Expand Down
25 changes: 17 additions & 8 deletions packages/extension/src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ const client = new Client({

const contextMenuId = '@crypt.fyi/encrypt-selection';

browser.contextMenus.create({
id: contextMenuId,
title: 'Encrypt and Share with crypt.fyi',
contexts: ['selection'],
});
browser.contextMenus.remove(contextMenuId).catch(() => {});
browser.contextMenus.create(
{
id: contextMenuId,
title: 'Encrypt and Share with crypt.fyi',
contexts: ['selection'],
},
() => {
const error = browser.runtime.lastError;
if (error) {
console.warn('[crypt.fyi] Context menu creation error:', error);
}
},
);

function isScriptableUrl(url: string): boolean {
return url.startsWith('http://') || url.startsWith('https://');
Expand Down Expand Up @@ -73,18 +82,18 @@ browser.contextMenus.onClicked.addListener(async (info: Menus.OnClickData, tab)

chrome.notifications.create({
type: 'basic',
iconUrl: chrome.runtime.getURL('icon-48.png'),
iconUrl: chrome.runtime.getURL('48.png'),
title: 'Text Encrypted',
message:
'The text has been encrypted and the secret URL has been copied to your clipboard. Send to the intended recipient.',
'Secret URL copied to clipboard. Ready to share.',
});
} catch (error) {
console.error('[crypt.fyi] Encryption failed:', error);

try {
chrome.notifications.create({
type: 'basic',
iconUrl: chrome.runtime.getURL('icon-48.png'),
iconUrl: chrome.runtime.getURL('48.png'),
title: 'Encryption Failed',
message: error instanceof Error ? error.message : 'An unknown error occurred',
});
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@crypt.fyi/server",
"version": "0.0.6",
"version": "0.0.7",
"main": "dist/index.js",
"description": "crypt.fyi server",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@crypt.fyi/web",
"private": true,
"version": "0.0.6",
"version": "0.0.7",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down

0 comments on commit 02e3420

Please sign in to comment.