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

Adding 2 new actions: prevent tab close and simple shortcut #11

Merged
merged 4 commits into from Jan 20, 2021

Conversation

dkzlv
Copy link
Contributor

@dkzlv dkzlv commented Nov 3, 2020

PR for issue #10

@swyxio
Copy link
Owner

swyxio commented Nov 3, 2020

thank you! leaving this open to invite comments, api discussion, docs notes, from anyone

@dkzlv
Copy link
Contributor Author

dkzlv commented Nov 7, 2020

Actually I found a bug in the binary logic there. If you introduce a shortcut like shift+1 the action will fire even if you press shift+alt+cmd+1.

I'll try to find a simple solution to this.

@dkzlv
Copy link
Contributor Author

dkzlv commented Nov 11, 2020

@sw-yx Fixed. Saved the new demo in REPL.

@swyxio
Copy link
Owner

swyxio commented Nov 11, 2020

thank you!

src/index.ts Outdated Show resolved Hide resolved
Comment on lines +178 to +179
window.removeEventListener('beforeunload', handler);
Copy link
Owner

Choose a reason for hiding this comment

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

TIL about https://developers.google.com/web/updates/2018/07/page-lifecycle-api#the-unload-event looks like you implemented it in the correct way

@dkzlv
Copy link
Contributor Author

dkzlv commented Jan 20, 2021

@sw-yx Wassup? :)

I wanted to submit another PR but I don't know if it makes sense if the repo is frozen.

@swyxio
Copy link
Owner

swyxio commented Jan 20, 2021

haha hey :) not much, just wanted to invite others to comment. but i can merge :)

@swyxio swyxio merged commit 30a45a7 into swyxio:main Jan 20, 2021
@swyxio
Copy link
Owner

swyxio commented Jan 20, 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.

None yet

2 participants