Ryan Christian D. Deniega commited on
Commit
4cb413f
Β·
1 Parent(s): ad25f0b

feat(extension): convert popup to persistent side panel

Browse files
extension/background.js CHANGED
@@ -145,6 +145,13 @@ async function verifyImageUrl(imageUrl) {
145
  return result
146
  }
147
 
 
 
 
 
 
 
 
148
  // ── Message handler ───────────────────────────────────────────────────────────
149
 
150
  chrome.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
 
145
  return result
146
  }
147
 
148
+ // ── Side panel ────────────────────────────────────────────────────────────────
149
+
150
+ // Open the side panel when the toolbar icon is clicked (stays open while browsing)
151
+ chrome.action.onClicked.addListener((tab) => {
152
+ chrome.sidePanel.open({ windowId: tab.windowId })
153
+ })
154
+
155
  // ── Message handler ───────────────────────────────────────────────────────────
156
 
157
  chrome.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
extension/manifest.json CHANGED
@@ -7,9 +7,14 @@
7
  "permissions": [
8
  "storage",
9
  "activeTab",
10
- "scripting"
 
11
  ],
12
 
 
 
 
 
13
  "host_permissions": [
14
  "https://www.facebook.com/*",
15
  "https://facebook.com/*",
@@ -67,7 +72,6 @@
67
  ],
68
 
69
  "action": {
70
- "default_popup": "popup.html",
71
  "default_title": "PhilVerify β€” Fact Check",
72
  "default_icon": {
73
  "16": "icons/icon16.png",
 
7
  "permissions": [
8
  "storage",
9
  "activeTab",
10
+ "scripting",
11
+ "sidePanel"
12
  ],
13
 
14
+ "side_panel": {
15
+ "default_path": "popup.html"
16
+ },
17
+
18
  "host_permissions": [
19
  "https://www.facebook.com/*",
20
  "https://facebook.com/*",
 
72
  ],
73
 
74
  "action": {
 
75
  "default_title": "PhilVerify β€” Fact Check",
76
  "default_icon": {
77
  "16": "icons/icon16.png",