The prepended semicolon breaks code (such as jQuery) that looks like:
foo = foo ? foo :
this.location;
I think the reason we started inserting the semicolon was because in situations like:
x = 1 + 2
this.location = "foo"
we used to rewrite to:
x = 1 + 2
(this && this._WB_wombat_obj_proxy || this).location = "foo"
which the browser would interpret as a bogus function call like `2(this && ... )`.
But nowadays prepending the semicolon should be unnecessary as we currently rewrite to:
x = 2 + 3
_____WB$wombat$check$this$function_____(this).location = "foo"
which will trigger JavaScript's automatic semicolon insertion rules like the original code does.
- Update and pin dependencies to specific versions that support Python 3.7-3.11
- Replace deprecated werkzeug.pop_path_info with wsgiref.shift_path_info
- Use the latest httpbin from psf/httpbin
- Remove unused flask test dependency
- Drop Python 2 and Python <3.7 support
- Ensure greenlet 2 is used for now, as psf/httpbin doesn't yet work with greenlet 3
---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
If default_locale was set, and a web page was visited that doesn't have a langauge code in the path in the URL, the URL path parts returned by get_locale_prefixes() was wrong (e.g. /hrst/ instead of /hr/test/).
If the default_locale was set and the URL path didn't contain a language code, it was behaving as if there was a language code in the URL. In that case, it was moving part of the PATH_INFO to SCRIPT_NAME, but as there wasn't any language code in the URL, it moved something else. This fixes that.
If the two letter language code was missing in the URI, switch_locale(locale) didn't add it (it worked fine if it was present). That means that it produced the same URL for all locales, each missing the two letter language code in the URL.
Add WACZ support for `wb-manager add` by unpacking WACZ files with --uncompress-wacz.
A future commit will add pywb support for WACZ files without requiring them to be unpacked.
substituion functionality already exists on a global level for matched
rules but this causes issues when rule sets conflict in the desired
outcome. This change enables setting regex substitution at the rule
level to avoid these conflicts.
* Fix 2.7.1 regressions
* Bump to 2.7.2
* fix redirect-to-exact false:
- check if current loaded timestamp is the same as to-redirected to timestamp, and avoid reload
* additional ui fixes:
- location bar: reload with current timestamp, instead of going to calendar
- ensure calendar popup on replay view is scrollable
- 'Live' mode fixes: don't cache live cdx entry, don't add timestamp when navigating in live mode without timestamp
- remember timeline view toggle on replay
- title: add 'Archived Page: ' prefix to document.title, consistent with old version
- ensure 'Archived Page: ' text is localizable
- ui: change ',' to '|' on capture display
* update CHANGES for 2.7.2
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
* Add locale-dependent handling of first day of week
The Intl.Locale is a proposed standard not yet supported by Firefox so
in Firefox the first day of week will default to Monday (as specified
in ISO-8601).
* Set top frame document title when Vue updates
* Update template guide for 2.7
* Drop Python 3.6 and add 3.10 in test CI
* Allow either JS mimetype in test_add_static
* Add convenience build script for Vue UI
* Add build flag to docker compose example
* Fix Vue app issue with redirect_to_exact: false
Fixes#779
Undated URLs were resulting in a broken calendar and timeline in the
Vue app when redirect_to_exact was set to false. This was due to
TopFrameView using the current datetime if no timestamp was included,
which caused a failed snapshot lookup in the Vue app.
This commit changes the default timestamp in TopFrameView to None and
adds additional logic in the Vue app to use the last snapshot's
timestamp as the default if one is not present to match the snapshot
that pywb loads by default under the same conditions.
* Add filter instead of submitting form when pressing enter in the filtering expression field
* Make filter expressions translatable
* Add missing tooltip strings to vue_loc
* Add changelog
* Bump version to 2.7.1
* Use empty string as default template timestamp
* Bump wombat to 3.3.13
Co-authored-by: Jonas Linde <jonasjlinde@gmail.com>