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 hs.webview.toolbar.get? #2109

Closed
latenitefilms opened this issue May 25, 2019 · 5 comments · Fixed by #2147
Closed

Add hs.webview.toolbar.get? #2109

latenitefilms opened this issue May 25, 2019 · 5 comments · Fixed by #2147

Comments

@latenitefilms
Copy link
Contributor

Currently when you use hs.webview.toolbar.new you need to assign each toolbar object with a unique name. However, currently there's no way to check that name isn't already in use.

@latenitefilms
Copy link
Contributor Author

Thoughts on this @cmsj & @asmagill ? This should be an easy issue to address?

@latenitefilms
Copy link
Contributor Author

FYI: I tried doing this myself, but failed, so will have to leave to someone smarter to tackle.

@asmagill
Copy link
Member

What exactly are you wanting? To get a toolbar object based on it's identifier (or nil, if it doesn't exist)? Or just a way to see if a specific identifier is already in use?

Not sure how to do the former, but the later would be simple since we track in-use identifiers in identifiersInUse in the toolbar_internal.m file.

@latenitefilms
Copy link
Contributor Author

@asmagill - Awesome, thanks! I'll have another look at this and see what I can come up with.

@asmagill
Copy link
Member

Take a look at the constructor for the module, around line 808 of toolbar_internal.m -- basically you could return true or false based on [identifiersInUse containsObject:identifier] which is what we check when creating a new toolbar.

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 a pull request may close this issue.

2 participants