@hanzo/browser-extension 1.9.46 → 1.9.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +12 -0
- package/package.json +16 -16
- package/src/answer/Rail.tsx +40 -14
- package/src/newtab.css +811 -243
- package/src/popup.html +0 -4
- package/src/sidebar.html +0 -8
- package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.pbxproj +0 -1059
- package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/universal-icon-1024@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/Contents.json +0 -6
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -21
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/icon128.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Base.lproj/Main.html +0 -20
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Icon.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Script.js +0 -24
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Style.css +0 -61
- package/dist/safari/Hanzo AI/Shared (App)/ViewController.swift +0 -81
- package/dist/safari/Hanzo AI/Shared (Extension)/SafariWebExtensionHandler.swift +0 -42
- package/dist/safari/Hanzo AI/iOS (App)/AppDelegate.swift +0 -24
- package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
- package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/Main.storyboard +0 -38
- package/dist/safari/Hanzo AI/iOS (App)/Info.plist +0 -27
- package/dist/safari/Hanzo AI/iOS (App)/SceneDelegate.swift +0 -18
- package/dist/safari/Hanzo AI/iOS (Extension)/Info.plist +0 -13
- package/dist/safari/Hanzo AI/macOS (App)/AppDelegate.swift +0 -21
- package/dist/safari/Hanzo AI/macOS (App)/Base.lproj/Main.storyboard +0 -124
- package/dist/safari/Hanzo AI/macOS (App)/Info.plist +0 -8
- package/dist/safari/Hanzo AI/macOS (Extension)/Info.plist +0 -13
- package/src/popup.js +0 -196
- package/src/sidebar.js +0 -885
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
|
3
|
-
<dependencies>
|
|
4
|
-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19085"/>
|
|
5
|
-
<plugIn identifier="com.apple.WebKit2IBPlugin" version="19085"/>
|
|
6
|
-
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
7
|
-
</dependencies>
|
|
8
|
-
<scenes>
|
|
9
|
-
<!--Application-->
|
|
10
|
-
<scene sceneID="JPo-4y-FX3">
|
|
11
|
-
<objects>
|
|
12
|
-
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
|
13
|
-
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
|
14
|
-
<items>
|
|
15
|
-
<menuItem title="Hanzo AI" id="1Xt-HY-uBw">
|
|
16
|
-
<modifierMask key="keyEquivalentModifierMask"/>
|
|
17
|
-
<menu key="submenu" title="Hanzo AI" systemMenu="apple" id="uQy-DD-JDr">
|
|
18
|
-
<items>
|
|
19
|
-
<menuItem title="About Hanzo AI" id="5kV-Vb-QxS">
|
|
20
|
-
<modifierMask key="keyEquivalentModifierMask"/>
|
|
21
|
-
<connections>
|
|
22
|
-
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
|
23
|
-
</connections>
|
|
24
|
-
</menuItem>
|
|
25
|
-
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
|
26
|
-
<menuItem title="Hide Hanzo AI" keyEquivalent="h" id="Olw-nP-bQN">
|
|
27
|
-
<connections>
|
|
28
|
-
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
|
29
|
-
</connections>
|
|
30
|
-
</menuItem>
|
|
31
|
-
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
|
32
|
-
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
|
33
|
-
<connections>
|
|
34
|
-
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
|
35
|
-
</connections>
|
|
36
|
-
</menuItem>
|
|
37
|
-
<menuItem title="Show All" id="Kd2-mp-pUS">
|
|
38
|
-
<modifierMask key="keyEquivalentModifierMask"/>
|
|
39
|
-
<connections>
|
|
40
|
-
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
|
41
|
-
</connections>
|
|
42
|
-
</menuItem>
|
|
43
|
-
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
|
44
|
-
<menuItem title="Quit Hanzo AI" keyEquivalent="q" id="4sb-4s-VLi">
|
|
45
|
-
<connections>
|
|
46
|
-
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
|
47
|
-
</connections>
|
|
48
|
-
</menuItem>
|
|
49
|
-
</items>
|
|
50
|
-
</menu>
|
|
51
|
-
</menuItem>
|
|
52
|
-
<menuItem title="Help" id="wpr-3q-Mcd">
|
|
53
|
-
<modifierMask key="keyEquivalentModifierMask"/>
|
|
54
|
-
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
|
55
|
-
<items>
|
|
56
|
-
<menuItem title="Hanzo AI Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
|
57
|
-
<connections>
|
|
58
|
-
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
|
59
|
-
</connections>
|
|
60
|
-
</menuItem>
|
|
61
|
-
</items>
|
|
62
|
-
</menu>
|
|
63
|
-
</menuItem>
|
|
64
|
-
</items>
|
|
65
|
-
</menu>
|
|
66
|
-
<connections>
|
|
67
|
-
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
|
68
|
-
</connections>
|
|
69
|
-
</application>
|
|
70
|
-
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
|
|
71
|
-
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
|
72
|
-
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
|
73
|
-
</objects>
|
|
74
|
-
<point key="canvasLocation" x="76" y="-134"/>
|
|
75
|
-
</scene>
|
|
76
|
-
<!--Window Controller-->
|
|
77
|
-
<scene sceneID="R2V-B0-nI4">
|
|
78
|
-
<objects>
|
|
79
|
-
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
|
|
80
|
-
<window key="window" title="Hanzo AI" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" animationBehavior="default" id="IQv-IB-iLA">
|
|
81
|
-
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
|
|
82
|
-
<windowCollectionBehavior key="collectionBehavior" fullScreenNone="YES"/>
|
|
83
|
-
<rect key="contentRect" x="196" y="240" width="425" height="325"/>
|
|
84
|
-
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
|
85
|
-
<connections>
|
|
86
|
-
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
|
87
|
-
</connections>
|
|
88
|
-
</window>
|
|
89
|
-
<connections>
|
|
90
|
-
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
|
91
|
-
</connections>
|
|
92
|
-
</windowController>
|
|
93
|
-
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
|
94
|
-
</objects>
|
|
95
|
-
<point key="canvasLocation" x="75" y="250"/>
|
|
96
|
-
</scene>
|
|
97
|
-
<!--View Controller-->
|
|
98
|
-
<scene sceneID="hIz-AP-VOD">
|
|
99
|
-
<objects>
|
|
100
|
-
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
|
101
|
-
<view key="view" id="m2S-Jp-Qdl">
|
|
102
|
-
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
|
|
103
|
-
<autoresizingMask key="autoresizingMask"/>
|
|
104
|
-
<subviews>
|
|
105
|
-
<wkWebView wantsLayer="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eOr-cG-IQY">
|
|
106
|
-
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
|
|
107
|
-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
108
|
-
<wkWebViewConfiguration key="configuration">
|
|
109
|
-
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
|
|
110
|
-
<wkPreferences key="preferences"/>
|
|
111
|
-
</wkWebViewConfiguration>
|
|
112
|
-
</wkWebView>
|
|
113
|
-
</subviews>
|
|
114
|
-
</view>
|
|
115
|
-
<connections>
|
|
116
|
-
<outlet property="webView" destination="eOr-cG-IQY" id="GFe-mU-dBY"/>
|
|
117
|
-
</connections>
|
|
118
|
-
</viewController>
|
|
119
|
-
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
|
120
|
-
</objects>
|
|
121
|
-
<point key="canvasLocation" x="75" y="655"/>
|
|
122
|
-
</scene>
|
|
123
|
-
</scenes>
|
|
124
|
-
</document>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SFSafariWebExtensionConverterVersion</key>
|
|
6
|
-
<string>26.5</string>
|
|
7
|
-
</dict>
|
|
8
|
-
</plist>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>NSExtension</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>NSExtensionPointIdentifier</key>
|
|
8
|
-
<string>com.apple.Safari.web-extension</string>
|
|
9
|
-
<key>NSExtensionPrincipalClass</key>
|
|
10
|
-
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</plist>
|
package/src/popup.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
// Hanzo AI — Popup Script
|
|
2
|
-
// Uses background message passing for auth (not direct storage access).
|
|
3
|
-
|
|
4
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
5
|
-
const loginSection = document.getElementById('login-section');
|
|
6
|
-
const mainSection = document.getElementById('main-section');
|
|
7
|
-
const settingsSection = document.getElementById('settings-section');
|
|
8
|
-
|
|
9
|
-
// Auth
|
|
10
|
-
const loginBtn = document.getElementById('login-btn');
|
|
11
|
-
const logoutBtn = document.getElementById('logout-btn');
|
|
12
|
-
|
|
13
|
-
// Open panel
|
|
14
|
-
const openPanel = document.getElementById('open-panel');
|
|
15
|
-
|
|
16
|
-
// Status dots
|
|
17
|
-
const zapStatus = document.getElementById('zap-status');
|
|
18
|
-
const zapDetail = document.getElementById('zap-detail');
|
|
19
|
-
const mcpStatus = document.getElementById('mcp-status');
|
|
20
|
-
const mcpPort = document.getElementById('mcp-port');
|
|
21
|
-
const cdpStatus = document.getElementById('cdp-status');
|
|
22
|
-
const cdpDetail = document.getElementById('cdp-detail');
|
|
23
|
-
const gpuStatus = document.getElementById('gpu-status');
|
|
24
|
-
const gpuDetail = document.getElementById('gpu-detail');
|
|
25
|
-
|
|
26
|
-
// Settings
|
|
27
|
-
const openSettings = document.getElementById('open-settings');
|
|
28
|
-
const backBtn = document.getElementById('back-btn');
|
|
29
|
-
const saveSettings = document.getElementById('save-settings');
|
|
30
|
-
const testConnection = document.getElementById('test-connection');
|
|
31
|
-
|
|
32
|
-
// --- Auth via background ---
|
|
33
|
-
function checkAuth() {
|
|
34
|
-
// Always show main section and status (tools work without login)
|
|
35
|
-
mainSection.classList.remove('hidden');
|
|
36
|
-
refreshStatus();
|
|
37
|
-
|
|
38
|
-
chrome.runtime.sendMessage({ action: 'auth.status' }, (response) => {
|
|
39
|
-
if (chrome.runtime.lastError) return;
|
|
40
|
-
if (response?.success && response.authenticated) {
|
|
41
|
-
loginSection.classList.add('hidden');
|
|
42
|
-
if (response.user) {
|
|
43
|
-
const avatar = document.getElementById('user-avatar');
|
|
44
|
-
const name = document.getElementById('user-name');
|
|
45
|
-
const email = document.getElementById('user-email');
|
|
46
|
-
avatar.src = response.user.picture || response.user.avatar || 'icon48.png';
|
|
47
|
-
name.textContent = response.user.name || response.user.displayName || 'Hanzo User';
|
|
48
|
-
email.textContent = response.user.email || '';
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
loginSection.classList.remove('hidden');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
loginBtn?.addEventListener('click', () => {
|
|
57
|
-
loginBtn.disabled = true;
|
|
58
|
-
loginBtn.textContent = 'Signing in...';
|
|
59
|
-
chrome.runtime.sendMessage({ action: 'auth.login' }, (response) => {
|
|
60
|
-
loginBtn.disabled = false;
|
|
61
|
-
loginBtn.innerHTML = '<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M15 12H3"/></svg> Sign in with Hanzo';
|
|
62
|
-
if (response?.success) {
|
|
63
|
-
checkAuth();
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
logoutBtn?.addEventListener('click', () => {
|
|
69
|
-
chrome.runtime.sendMessage({ action: 'auth.logout' }, () => {
|
|
70
|
-
mainSection.classList.add('hidden');
|
|
71
|
-
loginSection.classList.remove('hidden');
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// --- Open side panel ---
|
|
76
|
-
openPanel?.addEventListener('click', () => {
|
|
77
|
-
if (chrome.sidePanel) {
|
|
78
|
-
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
|
79
|
-
if (tabs[0]?.id) {
|
|
80
|
-
chrome.sidePanel.open({ tabId: tabs[0].id });
|
|
81
|
-
window.close();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
} else if (typeof browser !== 'undefined' && browser.sidebarAction) {
|
|
85
|
-
browser.sidebarAction.open();
|
|
86
|
-
window.close();
|
|
87
|
-
} else {
|
|
88
|
-
chrome.tabs.create({ url: chrome.runtime.getURL('sidebar.html') });
|
|
89
|
-
window.close();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// --- Status ---
|
|
94
|
-
function refreshStatus() {
|
|
95
|
-
// ZAP status
|
|
96
|
-
chrome.runtime.sendMessage({ action: 'zap.status' }, (response) => {
|
|
97
|
-
if (chrome.runtime.lastError) return;
|
|
98
|
-
if (response?.success) {
|
|
99
|
-
const zap = response.zap;
|
|
100
|
-
if (zap.connected) {
|
|
101
|
-
zapStatus.classList.add('connected');
|
|
102
|
-
zapStatus.classList.remove('disconnected');
|
|
103
|
-
const mcpCount = zap.mcps?.length || 0;
|
|
104
|
-
const toolCount = zap.mcps?.reduce((sum, m) => sum + (m.tools?.length || 0), 0) || 0;
|
|
105
|
-
zapDetail.textContent = `${mcpCount} MCP(s), ${toolCount} tools`;
|
|
106
|
-
} else {
|
|
107
|
-
zapStatus.classList.remove('connected');
|
|
108
|
-
zapStatus.classList.add('disconnected');
|
|
109
|
-
zapDetail.textContent = 'Not connected';
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// GPU status
|
|
115
|
-
chrome.runtime.sendMessage({ action: 'runLocalAI', prompt: '' }, (response) => {
|
|
116
|
-
if (chrome.runtime.lastError) return;
|
|
117
|
-
gpuStatus.classList.add(response?.success ? 'connected' : 'disconnected');
|
|
118
|
-
gpuStatus.classList.remove(response?.success ? 'disconnected' : 'connected');
|
|
119
|
-
gpuDetail.textContent = response?.success ? 'Available' : 'Not available';
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// MCP/CDP — set as active for now (checked via ZAP)
|
|
123
|
-
mcpStatus.classList.add('connected');
|
|
124
|
-
mcpPort.textContent = 'Fallback';
|
|
125
|
-
cdpStatus.classList.add('connected');
|
|
126
|
-
cdpDetail.textContent = 'Active';
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// --- Settings ---
|
|
130
|
-
openSettings?.addEventListener('click', () => {
|
|
131
|
-
mainSection.classList.add('hidden');
|
|
132
|
-
settingsSection.classList.remove('hidden');
|
|
133
|
-
loadSettings();
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
backBtn?.addEventListener('click', () => {
|
|
137
|
-
settingsSection.classList.add('hidden');
|
|
138
|
-
mainSection.classList.remove('hidden');
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
function loadSettings() {
|
|
142
|
-
chrome.storage.local.get(['mcpPort', 'cdpPort', 'zapPorts'], (result) => {
|
|
143
|
-
const mcpPortInput = document.getElementById('mcp-port-setting');
|
|
144
|
-
const cdpPortInput = document.getElementById('cdp-port-setting');
|
|
145
|
-
const zapPortsInput = document.getElementById('zap-ports-setting');
|
|
146
|
-
|
|
147
|
-
if (mcpPortInput) mcpPortInput.value = result.mcpPort || 3001;
|
|
148
|
-
if (cdpPortInput) cdpPortInput.value = result.cdpPort || 9223;
|
|
149
|
-
if (zapPortsInput) zapPortsInput.value = (result.zapPorts || [9999, 9998, 9997, 9996, 9995]).join(',');
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
saveSettings?.addEventListener('click', () => {
|
|
154
|
-
const mcpPortVal = parseInt(document.getElementById('mcp-port-setting')?.value) || 3001;
|
|
155
|
-
const cdpPortVal = parseInt(document.getElementById('cdp-port-setting')?.value) || 9223;
|
|
156
|
-
const zapPortsVal = (document.getElementById('zap-ports-setting')?.value || '')
|
|
157
|
-
.split(',').map(p => parseInt(p.trim())).filter(p => p > 0 && p < 65536);
|
|
158
|
-
|
|
159
|
-
chrome.storage.local.set({
|
|
160
|
-
mcpPort: mcpPortVal,
|
|
161
|
-
cdpPort: cdpPortVal,
|
|
162
|
-
zapPorts: zapPortsVal.length ? zapPortsVal : [9999, 9998, 9997, 9996, 9995],
|
|
163
|
-
}, () => {
|
|
164
|
-
saveSettings.textContent = 'Saved!';
|
|
165
|
-
setTimeout(() => { saveSettings.textContent = 'Save Settings'; }, 1500);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
// --- Test Connection ---
|
|
170
|
-
testConnection?.addEventListener('click', () => {
|
|
171
|
-
testConnection.textContent = 'Testing...';
|
|
172
|
-
testConnection.disabled = true;
|
|
173
|
-
|
|
174
|
-
chrome.runtime.sendMessage({ action: 'zap.discover' }, () => {
|
|
175
|
-
refreshStatus();
|
|
176
|
-
testConnection.textContent = 'Test Connection';
|
|
177
|
-
testConnection.disabled = false;
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Feature toggles
|
|
182
|
-
['source-maps', 'webgpu-ai', 'browser-control', 'tab-filesystem'].forEach(id => {
|
|
183
|
-
const checkbox = document.getElementById(id);
|
|
184
|
-
if (checkbox) {
|
|
185
|
-
chrome.storage.local.get([id], (result) => {
|
|
186
|
-
checkbox.checked = result[id] !== false; // default on
|
|
187
|
-
});
|
|
188
|
-
checkbox.addEventListener('change', () => {
|
|
189
|
-
chrome.storage.local.set({ [id]: checkbox.checked });
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// Init
|
|
195
|
-
checkAuth();
|
|
196
|
-
});
|