Skip to content
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

feature: allow embed <replay-web-page> to also support updating favicons from replay #287

Merged
merged 6 commits into from Mar 8, 2024

Conversation

ikreymer
Copy link
Member

@ikreymer ikreymer commented Mar 8, 2024

It may be useful to be able to have embed also take over the favicons for the page, propagating them from the replay (eg. if in a single page app where replay takes up most of the view).

This PR adds a updateFavicons attribute, used as <replay-web-page ... updateFavicons> to have icons propagated from the replay to the top-level frame. (This may be especially useful with deepLink option, which allows for linking directly to archived pages)

Details:

  • enabled via 'updateFavicons' attribute on
  • pass icons via postMessage() update, adding type to embed message to allow different types of message
  • currently supporting 'urlchange' and 'favicons' message types
  • add shared updateFaviconLinks() in misc.ts, used by both embed and main app

Testing:

  • To test, create an embedded viewer with a WACZ that has favicons and view with <replay-web-page ... updateFavicons>
    The top-level page favicons should get updated with icons from the replay
  • Opening via regular app view should also continue to change favicons (as before).

…ons from the replay

  - enabled via 'updateFavicons' attribute
  - pass icons via postMessage() update, adding type to embed message to allow different types of message
  - currently supporting 'urlchange' and 'favicons'
  - add shared updateFaviconLinks(), used by both embed and main app
@ikreymer ikreymer requested a review from emma-sg March 8, 2024 00:37
Copy link
Member

@emma-sg emma-sg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added relevant types to the edited blocks and also made sure all values we're passing into new URLSearchParams() are converted to strings, if they're not already.

Let me know if all these changes make sense?

…luding url, ts, view and query

only specific values as part of hashtag
only include view in hashtag if no url is set
@ikreymer ikreymer merged commit 6051a2a into dev-2.0.0 Mar 8, 2024
6 checks passed
@ikreymer ikreymer deleted the embed-update-favicons branch March 8, 2024 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants