-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve issues with window.open / anchor target rewriting #94
Comments
ikreymer
added a commit
that referenced
this issue
Oct 1, 2022
…get="..."> and window.open(..., target) to the specified named target, if set on the outer <iframe> fixes #94
ikreymer
added a commit
that referenced
this issue
Oct 2, 2022
…get="..."> and window.open(..., target) to the specified named target, if set on the outer <iframe> fixes #94 bump to 3.3.9
Merged
ikreymer
added a commit
to webrecorder/wabac.js
that referenced
this issue
Oct 2, 2022
…"target" rewriting as per webrecorder/wombat#94
ikreymer
added a commit
to webrecorder/replayweb.page
that referenced
this issue
Oct 2, 2022
- support target rewriting with named iframe as per webrecorder/wombat#94 - refactor sw init: detect additional errors, such as CORS issues in nested iframes - support cross-origin replaybase for embeds - add 'requirecrossoriginiframe' to restrict embed to only be loaded in subdomain iframes, otherwise showing - rename noSandbox -> sandbox, not enabled by default docs: add example embed to docs bump to 1.7.0-beta.1
ikreymer
added a commit
to webrecorder/wabac.js
that referenced
this issue
Oct 3, 2022
…ead (#84) * target rewrite: - support rewriting of target in <a target> and window.open(..., target) as per webrecorder/wombat#94 - use named top frame (___wb_replay_top_frame), set in wbinfo.target_rewrite for wombat - prevent anchor links / window.open() from opening in new windows - tests: update test to include target rewrite - dependencies: bump to wombat 3.3.9
ikreymer
added a commit
to webrecorder/replayweb.page
that referenced
this issue
Oct 4, 2022
…tter error messages (#126) * embeds: - support target rewriting with named iframe as per webrecorder/wombat#94 - refactor sw init: detect additional errors, such as CORS issues in nested iframes - support cross-origin replaybase for embeds - add 'requirecrossoriginiframe' to restrict embed to only be loaded in subdomain iframes, otherwise showing - rename noSandbox -> sandbox, not enabled by default init: set appName on service worker init docs: - add example embed to embedding doc - update docs for noSandbox -> sandbox - add warning if deprecated 'noSandbox' flag is used, explaining that it is now deprecated - update embedding and CHANGES.md with latest features - add tweet-example.wacz - add embed.html to test embeds bump to 1.7.0-beta.1
This was referenced Oct 5, 2022
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, there is no special handling for
<a target=...>
andwindow.open(..., target)
values, which affect where the URL will be loaded.In the case of
window.open()
, the url is rewritten without the mp_ modifier, causing it to open the top-frame in framed replay.However,
window.open(url, "_self")
can result in the URL opening in the same window, so need to keep themp_
modifier.Also, opening in new window / tab can cause unexpected behavior if replaying in an embedded mode (eg. replayweb.page embed).
Additionally,
_parent
, and_top
, can mess with the top-frame that contains the banner, which replayed pages should not access.The ideal behavior is to navigate within the top iframe itself, which can be given a specified named (in pywb / wabac.js).
The name can be provided via
wbinfo
inject.Plan to resolve as follows, for both anchor tag and window.open:
wbinfo.target_frame
is provided, replace any of_parent
,_top
,_blank
with that value, to ensure navigation happens with top frame.mp_
, to load the replay. This may result in banner not being shown if somehow a new window is open due to named context.Other option is to also replace named context with _self as well, thereby disallowing any other name, but that could break replay in some edge cases. (How often are named contexts used?)
For anchor tag rewriting, fix will likely involve pywb and wabac.js changes as well, while window.open() override can be handled here.
The text was updated successfully, but these errors were encountered: