vivekchakraverty Claude Opus 4.8 commited on
Commit
357c3d4
·
1 Parent(s): 6b506cb

Broaden PO-token capture (initplayback / any googlevideo request with pot=)

Browse files

Verified end-to-end by loading the real extension into headless Chromium (Playwright):
content_hook captures the gvs pot via the fetch/XHR hook, bridges it to session storage,
and fillSpaceFields populates the Space fields with input events. Broaden the URL matcher
beyond /videoplayback to also catch /initplayback and any googlevideo.com request carrying
a pot param.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

extension/background.js CHANGED
@@ -13,7 +13,8 @@ const FILTER = { urls: ["*://*.googlevideo.com/*"] };
13
  chrome.webRequest.onBeforeRequest.addListener(
14
  (details) => {
15
  try {
16
- if (details.url.indexOf("videoplayback") === -1) return;
 
17
  chrome.storage.session.set({ gvAnySeen: true, lastSeen: Date.now() });
18
  const u = new URL(details.url);
19
  const pot = u.searchParams.get("pot");
 
13
  chrome.webRequest.onBeforeRequest.addListener(
14
  (details) => {
15
  try {
16
+ if (details.url.indexOf("videoplayback") === -1 &&
17
+ details.url.indexOf("initplayback") === -1) return;
18
  chrome.storage.session.set({ gvAnySeen: true, lastSeen: Date.now() });
19
  const u = new URL(details.url);
20
  const pot = u.searchParams.get("pot");
extension/content_hook.js CHANGED
@@ -12,9 +12,15 @@
12
 
13
  function scanUrl(url) {
14
  try {
15
- if (!url || String(url).indexOf("videoplayback") === -1) return;
 
 
 
 
 
 
16
  report("seen", null);
17
- const u = new URL(url, location.href);
18
  const pot = u.searchParams.get("pot");
19
  if (pot) report("pot", { pot: pot, c: u.searchParams.get("c") || "" });
20
  } catch (e) {}
 
12
 
13
  function scanUrl(url) {
14
  try {
15
+ if (!url) return;
16
+ const s = String(url);
17
+ if (
18
+ s.indexOf("videoplayback") === -1 &&
19
+ s.indexOf("initplayback") === -1 &&
20
+ s.indexOf("googlevideo.com") === -1
21
+ ) return;
22
  report("seen", null);
23
+ const u = new URL(s, location.href);
24
  const pot = u.searchParams.get("pot");
25
  if (pot) report("pot", { pot: pot, c: u.searchParams.get("c") || "" });
26
  } catch (e) {}