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

Don't move Safari pinned tabs #9

Open
tedmiston opened this issue Apr 3, 2016 · 3 comments
Open

Don't move Safari pinned tabs #9

tedmiston opened this issue Apr 3, 2016 · 3 comments

Comments

@tedmiston
Copy link
Owner

In El Capitan, Safari introduced pinned tabs.

Related tools like OneTab do not disturb pinned tabs by default.

If it's possible through the AppleScript API, I'd like to create the same default behavior for Tab Transporter.

@tedmiston tedmiston self-assigned this Apr 3, 2016
@ghost
Copy link

ghost commented Sep 26, 2016

From what I can tell, you would need to use GUI scripting to get this done. The Safari dictionary doesn't show a difference between pinned tabs and regular tabs, but when using System Events to see the differences between the elements, you can discern which tabs are pinned and which are not.

Adding that functionality would mean that users of your script would have to enable the script to control the computer (you would want to update your Read Me to walk them through that process).

@tedmiston
Copy link
Owner Author

@seesolve It looks like you're correct. The offerings on tab properties in Chrome are much more elaborate: 20 properties (including a pinned boolean) vs 6 in Safari.

I'm wondering about workarounds...

Having do JavaScript to talk to Safari might be convenient, i.e.,

tell application "Safari"
    do JavaScript "alert('foo');" in current tab of front window
end tell

Note that even this call would require something similar — in Safari, you must check Develop > Allow JavaScript from Apple Events, for it to be able to run.

I'm wondering if it is possible to get pinned tab state through JS. Writing a Safari extension to do it wouldn't be my first choice for portability, but I'm open to trying it.

That said, looking through the Safari Extension docs, the API looks about the same as AppleScript. I didn't find a pinned property in The Windows and Tabs API. Particularly, I looked at the SafariBrowserTab or SafariBrowserWindow.

@ghost
Copy link

ghost commented Oct 6, 2016

Don't know much about Safari extensions...

@tedmiston tedmiston removed their assignment Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant