diff --git a/extensions/bear-split/background.js b/extensions/bear-split/background.js new file mode 100644 index 0000000..e7d44b2 --- /dev/null +++ b/extensions/bear-split/background.js @@ -0,0 +1,23 @@ +// MIT License — BearBrowser Bear Split +// Opens the current tab in a side-by-side split view. +"use strict"; + +function openSplit(currentUrl) { + const base = browser.runtime.getURL("split.html"); + const url = base + + "?left=" + encodeURIComponent(currentUrl || "about:blank") + + "&right=" + encodeURIComponent("about:blank"); + browser.tabs.create({ url }); +} + +browser.commands.onCommand.addListener((cmd) => { + if (cmd === "open-split") { + browser.tabs.query({ active: true, currentWindow: true }).then(([tab]) => { + openSplit(tab ? tab.url : "about:blank"); + }); + } +}); + +browser.browserAction.onClicked.addListener((tab) => { + openSplit(tab ? tab.url : "about:blank"); +}); diff --git a/extensions/bear-split/icons/split-48.svg b/extensions/bear-split/icons/split-48.svg new file mode 100644 index 0000000..ae5b7e0 --- /dev/null +++ b/extensions/bear-split/icons/split-48.svg @@ -0,0 +1,5 @@ + diff --git a/extensions/bear-split/manifest.json b/extensions/bear-split/manifest.json new file mode 100644 index 0000000..ba923d6 --- /dev/null +++ b/extensions/bear-split/manifest.json @@ -0,0 +1,45 @@ +{ + "manifest_version": 2, + "name": "Bear Split", + "version": "1.0.0", + "description": "Side-by-side split view tabs for BearBrowser. Closes the Arc split-view gap.", + "author": "mdheller", + "license": "MIT", + + "permissions": ["tabs", "storage", "commands"], + + "commands": { + "open-split": { + "suggested_key": { + "default": "Ctrl+Shift+Backslash", + "mac": "Command+Shift+Backslash" + }, + "description": "Open current tab in split view" + } + }, + + "background": { + "scripts": ["background.js"], + "persistent": false + }, + + "web_accessible_resources": ["split.html"], + + "browser_action": { + "default_title": "Bear Split", + "default_icon": { + "48": "icons/split-48.svg" + } + }, + + "icons": { + "48": "icons/split-48.svg" + }, + + "browser_specific_settings": { + "gecko": { + "id": "bear-split@bearbrowser.local", + "strict_min_version": "114.0" + } + } +} diff --git a/extensions/bear-split/split.html b/extensions/bear-split/split.html new file mode 100644 index 0000000..573beeb --- /dev/null +++ b/extensions/bear-split/split.html @@ -0,0 +1,163 @@ + + +
+ +