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

[BUG] example with-content-scripts-ui,where the CSUI container is lost after navigating within the SPA and upon returning. #939

Open
2 of 3 tasks
wkABXY opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wkABXY
Copy link

wkABXY commented Apr 11, 2024

What happened?

s there a good solution to the issue of the CSUI container getting lost during single-page navigation? This problem also exists in the official example with-content-scripts-ui, where the CSUI container is lost after navigating within the SPA and upon returning.
448792262860abd80b709a808610326
fc48e7ec97f9286385afde5292189c6
db3593953bc6689578b516a7d04a512
58e5991e39ce9239088071c2de0286d

Version

Latest

What OS are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@wkABXY wkABXY added the bug Something isn't working label Apr 11, 2024
@wkABXY wkABXY changed the title [BUG] [BUG] example with-content-scripts-ui,where the CSUI container is lost after navigating within the SPA and upon returning. Apr 11, 2024
@pwli0755
Copy link

pwli0755 commented Apr 17, 2024

same here, is there a way to hook something like afterNavigateEnd?

window.navigation.addEventListener("navigate", (event) => {
    console.log('location changed!', 'from: ', document.URL, 'to: ', event.destination.url);

    if (event.destination.url.includes("login")) {
        console.log(
            "hi there"
        )
        // do some html injection
        // the question is, this logic runs at the time when navigate happens, not when navigate ends
    }
})

Note that I want to do the injection only when the document.URL includes "login", how can I achive that without using setTimeout()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants