Skip to content

Commit

Permalink
Merge pull request #334 from openzim/iframe_rewrite
Browse files Browse the repository at this point in the history
Document wombat settings and change wombat mode to fix major issue of MDN ZIM
  • Loading branch information
benoit74 authored Nov 15, 2024
2 parents 20bf43f + 1eb41ff commit 8733200
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Upgrade to wombat 3.8.6 (#334)
- Fix wombat setup settings (especially `isSW`) (#293)

## [2.1.3] - 2024-11-01

### Changed
Expand Down
17 changes: 12 additions & 5 deletions javascript/src/wombatSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,21 @@ export function getWombatInfo(
// The host of the original url
wombat_host: orig_host,

// Extra options ?
wombat_opts: {},
// We are not running inside a service worker, wombat needs to know about it since
// some "magic" URLs like blobs are not available
isSW: false,

// ?
enable_auto_fetch: true,
// Convert all post request to get request
convert_post_to_get: true,

// Not used, we are not replaying in a frame
target_frame: '___wb_replay_top_frame',
isSW: true,

// Not used, we are not running in live mode
enable_auto_fetch: false,

// Extra options, not used
wombat_opts: {},
};
}

Expand Down
4 changes: 2 additions & 2 deletions javascript/test/wombatSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ test('nominalWbInfo', (t) => {
);
t.is(wmInfo.coll, '');
t.is(wmInfo.convert_post_to_get, true);
t.is(wmInfo.enable_auto_fetch, true);
t.is(wmInfo.isSW, true);
t.is(wmInfo.enable_auto_fetch, false);
t.is(wmInfo.isSW, false);
t.is(wmInfo.is_framed, false);
t.is(wmInfo.is_live, false);
t.is(wmInfo.mod, '');
Expand Down
2 changes: 1 addition & 1 deletion openzim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ execute_after=[

[files.assets.actions."wombat.js"]
action="get_file"
source="https://cdn.jsdelivr.net/npm/@webrecorder/[email protected].3/dist/wombat.js"
source="https://cdn.jsdelivr.net/npm/@webrecorder/[email protected].6/dist/wombat.js"
target_file="wombat.js"

[files.assets.actions."wombatSetup.js"] # fallback if this script has not been properly build (should happen only in dev)
Expand Down

0 comments on commit 8733200

Please sign in to comment.