Skip to content

Add Safari Extension - #182

Merged
thomaspaulmann merged 18 commits into
raycast:mainfrom
loris:safari-cloud-tabs
Oct 25, 2021
Merged

thomaspaulmann merged 18 commits into
raycast:mainfrom
loris:safari-cloud-tabs

Conversation

@loris

@loris loris commented Oct 22, 2021 •

Copy link
Copy Markdown
Contributor

Description

Here is an extension which:

  • list your Cloud Tabs from all your devices (Mac, iPhone, iPad) which are connected to your iCloud account and open them on your Mac.
  • list your Reading List

Feel free to test and give me feedbacks.

Type of change

  • New extension

Screencast

Cloud Tabs

image

Reading List

image

Checklist

@aesign

aesign commented Oct 22, 2021 •

Copy link
Copy Markdown
Contributor

Neat! Awesome idea. I'm getting an error though:

CleanShot 2021-10-22 at 19 10 48@2x

CleanShot 2021-10-22 at 19 12 38@2x

@loris

loris commented Oct 22, 2021

Copy link
Copy Markdown
Contributor Author

@aesign Thanks for testing! Can you confirm that it works fine if you give Raycast permission for "Full disk access" like on this screenshot:
image

If so, I will add an error handling and display instruction to the user to do so as discussed in that thread:
image

@aesign

aesign commented Oct 22, 2021 •

Copy link
Copy Markdown
Contributor

@loris Yes! That was the problem. Works now! I've got a few suggestions:

  • I'd add a keywords prop to the <List.Item> component so you can filter not only by the tab name, but even by its URL (keywords={[getProtocolLessUrl(tab.url)]}).
  • I'd put the device I'm on as first in the sections order (currently, I've got my iPhone's section on top)
  • I'd create a "Active Tab" section with just the currently active tab (or better, make it first on the list with its rightAccessory with an "Active" text inside)

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Got the same error at the same time as @aesign, and confirmed that it's working after giving full disk access.

  • Are you working on the try-catch error showing a nice message about what's going wrong?
  • Did you think about if it should open in a specific browser or just leave it with the default?

@loris loris changed the title Add Safari Cloud Tabs Extension WIP: Add Safari Cloud Tabs Extension Oct 22, 2021
@loris
loris marked this pull request as draft October 22, 2021 18:01
@loris

loris commented Oct 22, 2021

Copy link
Copy Markdown
Contributor Author

Great feedbacks guys. I converted the PR back in Draft mode and will work on them soon.

@thomaspaulmann

Copy link
Copy Markdown
Member

Just a tip, looks like you can use WASM to run SQL instead of relying on the CLI. There is an example in #172. This should be a lil faster and safer.

loris added 2 commits October 23, 2021 01:14
- Force opening links in Safari
- Put current device tabs on top
@loris loris changed the title WIP: Add Safari Cloud Tabs Extension Add Safari Cloud Tabs Extension Oct 24, 2021
@loris
loris marked this pull request as ready for review October 24, 2021 11:15
@loris

loris commented Oct 24, 2021

Copy link
Copy Markdown
Contributor Author

Guys, ok it seems ready for reviewing again.

  • Switched to sql.js (with WASM)
  • Added the tab url in the keywords prop (please note that [API Feature Request] List filtering: Extend fuzzy search over keywords #64 will need to be addressed first to be really useful)
  • Put the tabs from the current device on top (let me know if it does not work, I'm using the CLI command /usr/sbin/scutil --get ComputerName to fetch the current device name)
  • Forced opening of links in Safari (in case it is not the default browser)
  • Added a try/catch in case of permission errors, and display the following instructions (please note that IMO, it should be handled at the Raycast level: [API Feature Request] Permissions #101)

image

@loris loris changed the title Add Safari Cloud Tabs Extension Add Safari Extension Oct 24, 2021
@loris

loris commented Oct 24, 2021

Copy link
Copy Markdown
Contributor Author

I renamed the extension (and updated the description) to Safari because I added a 2nd command to list/search/open Safari Reading List

@loris

loris commented Oct 25, 2021

Copy link
Copy Markdown
Contributor Author

@thomaspaulmann haha, let me know if it scales nicely.

@thomaspaulmann

Copy link
Copy Markdown
Member

Loaded 100 tabs almost instantly 🤯 Such a good job 👏

@pernielsentikaer

Copy link
Copy Markdown
Contributor

💣 💣 💣

@thomaspaulmann

Copy link
Copy Markdown
Member

CleanShot 2021-10-28 at 10 15 22@2x

This extension got an hotkey! Using it a ton. Thanks for making it @loris 🙇

@thomaspaulmann

Copy link
Copy Markdown
Member

Idea: Have some more actions, e.g. close tab. Could be handy if you want to clean up your billion tabs :D Should be doable with AppleScript and you can check the script commands for it.

FezVrasta pushed a commit to FezVrasta/extensions that referenced this pull request Nov 24, 2021
gitbook-com Bot pushed a commit that referenced this pull request Mar 9, 2022
colebemis added a commit to colebemis/raycast-extensions that referenced this pull request Nov 6, 2024