From ef0217e4807b81dfebe3a1ea60eadadd3ceb3b52 Mon Sep 17 00:00:00 2001 From: Michael Heller <21163552+mdheller@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:45:16 -0400 Subject: [PATCH] =?UTF-8?q?feat(extensions):=20Bear=20Split=20=E2=80=94=20?= =?UTF-8?q?side-by-side=20split=20view=20tabs=20(Arc=20gap=20closure)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit extensions/bear-split/ — MV2 WebExtension for LibreWolf/Firefox: manifest.json: - CMD+SHIFT+\ / Ctrl+Shift+\ keyboard shortcut to open split view - browser_action toolbar button - web_accessible_resources: split.html - gecko id: bear-split@bearbrowser.local background.js: - commands.onCommand("open-split"): opens split.html?left=&right=about:blank - browserAction.onClicked: same; takes current tab URL as left pane seed split.html (fully self-contained, no external deps): - Two URL bars (LEFT/RIGHT labels) + two iframes side by side - Draggable divider: mousedown → mousemove adjusts flex widths; iframes get pointer-events:none during drag to prevent event capture - Min pane width 80px; divider highlights teal (#39C5CF) on hover/drag - URL input: Enter or Go button navigates; auto-prefixes https:// if no scheme - sandbox: allow-scripts allow-forms allow-same-origin allow-popups allow-downloads - Memory mesh ping on open + on each navigation (POST localhost:7788/api/append) icons/split-48.svg: - Two rectangles with dashed center divider, brand teal --- extensions/bear-split/background.js | 23 ++++ extensions/bear-split/icons/split-48.svg | 5 + extensions/bear-split/manifest.json | 45 +++++++ extensions/bear-split/split.html | 163 +++++++++++++++++++++++ 4 files changed, 236 insertions(+) create mode 100644 extensions/bear-split/background.js create mode 100644 extensions/bear-split/icons/split-48.svg create mode 100644 extensions/bear-split/manifest.json create mode 100644 extensions/bear-split/split.html 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 @@ + + + + +Bear Split + + + +
+
+
+ + + +
+ +
+ +
+ +
+
+ + + +
+ +
+
+ + + +