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

Add launch_handler explainer #35

Merged
merged 1 commit into from
Jul 28, 2021
Merged

Conversation

alancutter
Copy link
Collaborator

Created explainer from discussion: #33
View rendered markdown: https://github.com/alancutter/sw-launch/blob/launch_handler/launch_handler.md

Moved from manifest-incubations pull request: WICG/manifest-incubations#14

Copy link
Member

@mgiuca mgiuca left a comment

Choose a reason for hiding this comment

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

lgtm (based on discussion on WICG/manifest-incubations#14)

};

partial interface Window {
readonly attribute LaunchQueue launchQueue;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be cautious about adding things to the Window object. I don't have a better suggestion of where to put it, but doing this can be risky because it can clash with userland code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the main risk is if code does something like this:

launch_queue.js:
if (!window.launchQueue)
  window.launchQueue = new SomeLaunchQueueClass();


main.js:
window.launchQueue.someMethod(someParam);


index.html:
<script src="launch_queue.js"></script>
<script src="main.js"></script>

Do you know of any other code patterns that would break?

@alancutter alancutter merged commit e02fca5 into WICG:main Jul 28, 2021
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.

3 participants