SMRY icon indicating copy to clipboard operation
SMRY copied to clipboard

[idea] Publish a Chrome extension for opening links in smry

Open vfmatzkin opened this issue 1 year ago • 1 comments

You can build a very simple extension that would open the desired link into a new tab in smry with this extension:

background.js

chrome.runtime.onInstalled.addListener(() => {
 chrome.contextMenus.create({
   id: "smryAI",
   title: "Open with SMRY.AI",
   contexts: ["link"]
 });
});

chrome.contextMenus.onClicked.addListener((info, tab) => {
 if (info.menuItemId === "smryAI") {
   const url = `https://www.smry.ai/proxy?url=${encodeURIComponent(info.linkUrl)}`;
   chrome.tabs.create({ url });
 }
});

manifest.json

{
  "manifest_version": 3,
  "name": "Open with SMRY.AI",
  "version": "1.0",
  "description": "Open selected URL with SMRY.AI",
  "permissions": [
    "contextMenus",
    "tabs"
  ],
  "background": {
    "service_worker": "background.js"
  },
  "icons": {
    "16": "icon16.png",
    "48": "icon48.png",
    "128": "icon128.png"
  }
}

This way you could just go straight to the smry website with two clicks: image

Thanks for your service!

Cheers!

vfmatzkin avatar May 28 '24 19:05 vfmatzkin

+1 it would be good.

Norjak avatar Aug 20 '24 17:08 Norjak