Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

comments

Richie McIlroy062acdffeca7
diff --git a/apps/chrome-extension/public/manifest.json b/apps/chrome-extension/public/manifest.json
index de8c8170c..156cacdbb 100644
--- a/apps/chrome-extension/public/manifest.json
+++ b/apps/chrome-extension/public/manifest.json
@@ -34,10 +34,10 @@
"storage",
"tabCapture"
],
- "host_permissions": ["<all_urls>"],
+ "host_permissions": ["http://*/*", "https://*/*", "file:///*"],
"content_scripts": [
{
- "matches": ["<all_urls>"],
+ "matches": ["http://*/*", "https://*/*", "file:///*"],
"js": ["assets/content-bootstrap.js"],
"run_at": "document_idle"
}
@@ -45,11 +45,11 @@
"web_accessible_resources": [
{
"resources": ["icons/*", "content/overlay.js"],
- "matches": ["<all_urls>"]
+ "matches": ["http://*/*", "https://*/*", "file:///*"]
},
{
"resources": ["camera-preview.html", "popup.html"],
- "matches": ["<all_urls>"],
+ "matches": ["http://*/*", "https://*/*", "file:///*"],
"use_dynamic_url": true
}
]
diff --git a/apps/chrome-extension/src/content/overlay.tsx b/apps/chrome-extension/src/content/overlay.tsx
index 2313fdd08..c83f93aee 100644
--- a/apps/chrome-extension/src/content/overlay.tsx
+++ b/apps/chrome-extension/src/content/overlay.tsx
@@ -326,9 +326,17 @@ type PanelFrameMessage =
const isPanelFrameMessage = (value: unknown): value is PanelFrameMessage => {
if (!value || typeof value !== "object") return false;
const candidate = value as Partial<PanelFrameMessage>;
+ if (
+ candidate.source !== "cap-extension-panel" ||
+ candidate.token !== PANEL_TOKEN
+ ) {
+ return false;
+ }
+ if (candidate.type === "dismiss") return true;
return (
- candidate.source === "cap-extension-panel" &&
- candidate.token === PANEL_TOKEN
+ candidate.type === "size" &&
+ typeof candidate.height === "number" &&
+ Number.isFinite(candidate.height)
);
};