From b3e103f4ca5b76abf0bc6fb51d0d56aa82eb97ca Mon Sep 17 00:00:00 2001 From: jgsncsggjv-tech Date: Wed, 14 Jan 2026 08:56:34 +0000 Subject: [PATCH 1/3] Add Opera extension: Google Search popup, context menu, icons, and README --- opera-extension/README.md | 24 ++++++++++++++++++++++++ opera-extension/background.js | 15 +++++++++++++++ opera-extension/icons/icon128.png | 1 + opera-extension/icons/icon128.svg | 7 +++++++ opera-extension/icons/icon48.png | 1 + opera-extension/icons/icon48.svg | 7 +++++++ opera-extension/manifest.json | 21 +++++++++++++++++++++ opera-extension/popup.html | 19 +++++++++++++++++++ opera-extension/popup.js | 10 ++++++++++ opera-extension/screenshots/popup.svg | 11 +++++++++++ opera-extension/styles.css | 6 ++++++ 11 files changed, 122 insertions(+) create mode 100644 opera-extension/README.md create mode 100644 opera-extension/background.js create mode 100644 opera-extension/icons/icon128.png create mode 100644 opera-extension/icons/icon128.svg create mode 100644 opera-extension/icons/icon48.png create mode 100644 opera-extension/icons/icon48.svg create mode 100644 opera-extension/manifest.json create mode 100644 opera-extension/popup.html create mode 100644 opera-extension/popup.js create mode 100644 opera-extension/screenshots/popup.svg create mode 100644 opera-extension/styles.css diff --git a/opera-extension/README.md b/opera-extension/README.md new file mode 100644 index 0000000000..554b513ba3 --- /dev/null +++ b/opera-extension/README.md @@ -0,0 +1,24 @@ +# Google Search (Opera) — Extension + +This small Opera extension adds: + +- a context menu item when text is selected: "Search Google for \"%s\"" +- a popup to type a query or open Google quickly + +Screenshots: + +![Popup screenshot](screenshots/popup.svg) + +How to load in Opera: + +1. Open Opera and navigate to `opera://extensions`. +2. Enable Developer mode (toggle in the top-right). +3. Click **Load unpacked** and select this folder: the `opera-extension` directory. + +Icon preview: + +![Icon preview](icons/icon128.svg) + +Notes: + +- This is a Chromium-style extension and should be compatible with Opera's extension system. diff --git a/opera-extension/background.js b/opera-extension/background.js new file mode 100644 index 0000000000..5f9cd9197e --- /dev/null +++ b/opera-extension/background.js @@ -0,0 +1,15 @@ +chrome.runtime.onInstalled.addListener(() => { + chrome.contextMenus.create({ + id: 'search-google', + title: 'Search Google for "%s"', + contexts: ['selection'] + }); +}); + +chrome.contextMenus.onClicked.addListener((info, tab) => { + if (info.menuItemId === 'search-google') { + const query = info.selectionText || ''; + const url = 'https://www.google.com/search?q=' + encodeURIComponent(query); + chrome.tabs.create({ url }); + } +}); diff --git a/opera-extension/icons/icon128.png b/opera-extension/icons/icon128.png new file mode 100644 index 0000000000..96a2f73627 --- /dev/null +++ b/opera-extension/icons/icon128.png @@ -0,0 +1 @@ +placeholder: create a 128x128 PNG icon and replace this file diff --git a/opera-extension/icons/icon128.svg b/opera-extension/icons/icon128.svg new file mode 100644 index 0000000000..edd15a4f39 --- /dev/null +++ b/opera-extension/icons/icon128.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/opera-extension/icons/icon48.png b/opera-extension/icons/icon48.png new file mode 100644 index 0000000000..1367102119 --- /dev/null +++ b/opera-extension/icons/icon48.png @@ -0,0 +1 @@ +placeholder: create a 48x48 PNG icon and replace this file diff --git a/opera-extension/icons/icon48.svg b/opera-extension/icons/icon48.svg new file mode 100644 index 0000000000..a7490c6588 --- /dev/null +++ b/opera-extension/icons/icon48.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/opera-extension/manifest.json b/opera-extension/manifest.json new file mode 100644 index 0000000000..b9e2e72543 --- /dev/null +++ b/opera-extension/manifest.json @@ -0,0 +1,21 @@ +{ + "manifest_version": 3, + "name": "Google Search (Opera)", + "description": "Adds a context-menu and popup to quickly search selected text on Google.", + "version": "1.0.0", + "permissions": ["contextMenus", "tabs"], + "background": { + "service_worker": "background.js" + }, + "action": { + "default_popup": "popup.html", + "default_icon": { + "48": "icons/icon48.svg", + "128": "icons/icon128.svg" + } + }, + "icons": { + "48": "icons/icon48.svg", + "128": "icons/icon128.svg" + } +} diff --git a/opera-extension/popup.html b/opera-extension/popup.html new file mode 100644 index 0000000000..641abc90d0 --- /dev/null +++ b/opera-extension/popup.html @@ -0,0 +1,19 @@ + + + + + + Google Search + + + +
+ +
+ + +
+
+ + + diff --git a/opera-extension/popup.js b/opera-extension/popup.js new file mode 100644 index 0000000000..221aab2627 --- /dev/null +++ b/opera-extension/popup.js @@ -0,0 +1,10 @@ +document.getElementById('search').addEventListener('click', () => { + const q = document.getElementById('q').value.trim(); + if (!q) return; + const url = 'https://www.google.com/search?q=' + encodeURIComponent(q); + chrome.tabs.create({ url }); +}); + +document.getElementById('open').addEventListener('click', () => { + chrome.tabs.create({ url: 'https://www.google.com/' }); +}); diff --git a/opera-extension/screenshots/popup.svg b/opera-extension/screenshots/popup.svg new file mode 100644 index 0000000000..dc8ccaff0e --- /dev/null +++ b/opera-extension/screenshots/popup.svg @@ -0,0 +1,11 @@ + + + + Search Google... + + example query + + Search + + Open Google + diff --git a/opera-extension/styles.css b/opera-extension/styles.css new file mode 100644 index 0000000000..6ed8d214ee --- /dev/null +++ b/opera-extension/styles.css @@ -0,0 +1,6 @@ +body{font-family: system-ui, Arial, sans-serif; margin:0; padding:8px; width:260px} +.container{display:flex;flex-direction:column;gap:8px} +input#q{padding:8px;border:1px solid #ccc;border-radius:4px;width:100%} +.buttons{display:flex;gap:8px} +button{flex:1;padding:8px;border:none;border-radius:4px;background:#1a73e8;color:#fff;cursor:pointer} +button#open{background:#5f6368} From a650472e62de6a1705b668e3ce8571efe9cbf482 Mon Sep 17 00:00:00 2001 From: jgsncsggjv-tech Date: Wed, 14 Jan 2026 09:02:54 +0000 Subject: [PATCH 2/3] Use PNG icons in manifest and README --- opera-extension/README.md | 2 +- opera-extension/manifest.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opera-extension/README.md b/opera-extension/README.md index 554b513ba3..abe3feab9a 100644 --- a/opera-extension/README.md +++ b/opera-extension/README.md @@ -17,7 +17,7 @@ How to load in Opera: Icon preview: -![Icon preview](icons/icon128.svg) +![Icon preview](icons/icon128.png) Notes: diff --git a/opera-extension/manifest.json b/opera-extension/manifest.json index b9e2e72543..de0c2eaaeb 100644 --- a/opera-extension/manifest.json +++ b/opera-extension/manifest.json @@ -10,12 +10,12 @@ "action": { "default_popup": "popup.html", "default_icon": { - "48": "icons/icon48.svg", - "128": "icons/icon128.svg" + "48": "icons/icon48.png", + "128": "icons/icon128.png" } }, "icons": { - "48": "icons/icon48.svg", - "128": "icons/icon128.svg" + "48": "icons/icon48.png", + "128": "icons/icon128.png" } } From fdff9ab0ebbf0fe4adafbe7ed21cdba6f583d122 Mon Sep 17 00:00:00 2001 From: jgsncsggjv-tech Date: Wed, 14 Jan 2026 09:11:36 +0000 Subject: [PATCH 3/3] Export PNG icons from SVG --- opera-extension/icons/icon128.png | Bin 61 -> 2382 bytes opera-extension/icons/icon48.png | Bin 59 -> 1186 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/opera-extension/icons/icon128.png b/opera-extension/icons/icon128.png index 96a2f7362760d9e4c86d4e4d022a465f9681f7c5..88df5a5a62d916174dac0994c8e1491a4b9558e0 100644 GIT binary patch literal 2382 zcmcImXH%046MYgP5E82NA`m(PiV6gQ5Q-)gk*YBQK~SU@gAk+`iu8^UP&7oaA|+Qr zjfzneBp`UBm}tl58f~D?ChR7JF~O1Gdp`W*WC>xE~YF70D!m?*3okZ z$$wlFvJ*Q{XL@!366k_)1h)TJ?aRC6007v}bhOnsYJX6~jz z%Wy{HzP`sdZqsF&t(`ebx1BbE@S!-XLivgV9*PeTkF!4?S}cPa{BWkl;n_})Pn-Si znIoz>;C-mDLf*5iEex+SI~V*mH>iuvwb{_hyfW+CB|NgmnP20k9Q{)cMV{J!vPk#UVm{5LS}`*r&jpLvS9LC`qG`h(Qg=Mwf{?vM>HEd?2zW|hY$1158FVZb zc=x}M152lXCmFOhRvO1puW};HAr#a#jZgss0*oLNnMLFK0+C~CM=`}&wYsiFL!1^J zTXj}W^w%OWtN5t*4v`hR`f7wPv%!E=k=Wye@Q_g0s4`(LQFRj=A+k0;=6> z2JG^1e4YlI{IGWCBgv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