vivekchakraverty Claude Opus 4.8 commited on
Commit
1ea78e7
·
1 Parent(s): e935ba7

Fix extension zip nesting so Load unpacked works

Browse files

Zip the extension's files at the archive root (manifest.json at top level) instead of
under an extension/ subfolder, so the unzipped folder can be selected directly in
"Load unpacked". Clarify the install step (select the folder containing manifest.json).

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

Files changed (2) hide show
  1. app.py +4 -3
  2. extension/README.md +5 -2
app.py CHANGED
@@ -33,14 +33,15 @@ EXTENSION_DIR = os.path.join(APP_DIR, "extension")
33
  def _build_extension_zip() -> str | None:
34
  """Zip the bundled browser extension for one-click download; return the .zip path.
35
 
36
- Produces an archive whose top-level folder is ``extension/`` so it unzips to a
37
- ready-to-"Load unpacked" directory. Returns None if the folder isn't present.
 
38
  """
39
  if not os.path.isdir(EXTENSION_DIR):
40
  return None
41
  out_base = os.path.join(tempfile.gettempdir(), "tutorialmaker-extension")
42
  try:
43
- return shutil.make_archive(out_base, "zip", root_dir=APP_DIR, base_dir="extension")
44
  except Exception:
45
  return None
46
 
 
33
  def _build_extension_zip() -> str | None:
34
  """Zip the bundled browser extension for one-click download; return the .zip path.
35
 
36
+ The extension's files (manifest.json, etc.) sit at the **root** of the archive, so the
37
+ unzipped folder directly contains manifest.json and can be selected as-is in
38
+ "Load unpacked". Returns None if the folder isn't present.
39
  """
40
  if not os.path.isdir(EXTENSION_DIR):
41
  return None
42
  out_base = os.path.join(tempfile.gettempdir(), "tutorialmaker-extension")
43
  try:
44
+ return shutil.make_archive(out_base, "zip", root_dir=EXTENSION_DIR)
45
  except Exception:
46
  return None
47
 
extension/README.md CHANGED
@@ -12,9 +12,12 @@ It just surfaces these for one-click copy; it sends nothing anywhere.
12
 
13
  ## Install (unpacked)
14
 
15
- 1. Open `chrome://extensions` (or `edge://extensions`).
16
  2. Turn on **Developer mode** (top-right).
17
- 3. Click **Load unpacked** and select this `extension/` folder.
 
 
 
18
 
19
  > Firefox: it's MV3-compatible in spirit, but Firefox needs a `background.scripts` entry
20
  > and a `browser_specific_settings` block instead of `service_worker`. Minor manifest
 
12
 
13
  ## Install (unpacked)
14
 
15
+ 1. Open `chrome://extensions` (or `edge://extensions`, `comet://extensions`).
16
  2. Turn on **Developer mode** (top-right).
17
+ 3. Click **Load unpacked** and select the folder that **directly contains
18
+ `manifest.json`** — i.e. the unzipped download folder, or this `extension/` folder if
19
+ you cloned the repo. (If you see a "Manifest file is missing" error, you selected a
20
+ parent folder — go one level deeper to the one holding `manifest.json`.)
21
 
22
  > Firefox: it's MV3-compatible in spirit, but Firefox needs a `background.scripts` entry
23
  > and a `browser_specific_settings` block instead of `service_worker`. Minor manifest