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

fix: prevent duplicate output #235

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Conversation

kineticjs
Copy link
Contributor

Fixes duplicate action execution the following scenario:

  1. Select a control from the control tree and execute an action e.g. 'copy control to console'
  2. Close and reopen the DevTools, while staying on the same page and URL (no navigation)
  3. Repeat step 1
    Expected: the same result as received for step 1
    Actual: the result is displayed twice (e.g. control is copied to the console twice)

On inspection we see that the content script "content/main.js" is injected each time the devTools is reopened.
This happens on request from the script behind the UI5-Inspector tab in DevTools because that script is also
re-executed whenever the DevTools panel is opened and it does not keep any state that persists between the multiple
close and reopen of the panel.

Fixed by adding a flag to the window object that keeps the 'injected' state, so that the initializations inside the content script are not executed more than once.

@jdichev jdichev merged commit 8499c45 into SAP:master Apr 13, 2023
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.6.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants