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

Port extension to Safari #82

Open
6 of 8 tasks
feep opened this issue Apr 18, 2024 · 12 comments
Open
6 of 8 tasks

Port extension to Safari #82

feep opened this issue Apr 18, 2024 · 12 comments

Comments

@feep
Copy link
Contributor

feep commented Apr 18, 2024

Clarifying requirements for bounty

In scope

  • Build Safari web extension
  • readme.md explaining how to build locally
  • Same functionality as Chrome extension
  • Able to run in dev mode for testing by Rows
  • Minimal single screen, example:
    image
  • About box

Out of scope

Anything not listed as in scope, for example:

  • Safari app extension
  • CI for build
  • Non-mac Safari (iOS...)
  • Signing for App store
  • Submission to App store
  • Anything involved with distribution
  • Art for app icons
  • Copy (legal or otherwise) that Apple requires
@feep
Copy link
Contributor Author

feep commented Apr 18, 2024

If that scope looks OK, please assign to me.

thanks, rusty

@feep
Copy link
Contributor Author

feep commented Apr 18, 2024

Also, please exempt this bounty from made publicly available requirement:

features are only eligible for a bounty once they are approved by our team and made publicly available.

The submission and public distribution should be done by Rows, not by the person who completes the issue.

@henriquemcruz
Copy link
Collaborator

Thanks for taking on the challenge @feep ! I just assigned it to you, that's the scope.
Please keep code duplication to a minimum so that it is easier to maintain. TY!

cc @ricardofelgueiras

feep added a commit to feep/X that referenced this issue Apr 19, 2024
The deleted bounty was (I believe) closed by rows#82.
@feep
Copy link
Contributor Author

feep commented Apr 23, 2024

Probably unsupported 😿, still working on a minimal reproduction.

Will get back to you on that, Safari’s extension debugging is... limited. And Apple’s transparency on feature support is... hazy.

Anyway,

Progress report (the good):

image

image

The bad:

  1. The service_worker script failed to load due to an error., best I can tell, there is no debug UI available for this error in Safari.

image

  1. UI loads. But does not connect, so is useless

image

The server is running

❯ curl -I http://localhost:5173
HTTP/1.1 200 OK
...

So,

Hmmph. Done banging my head on it for now. Going for for a walk.

Will report back when I have a minimal test case.

rusty

@feep
Copy link
Contributor Author

feep commented Apr 23, 2024

Always try one more thing before you give up. Prod extension works, dev-mode extension does not.

Progress report

image

But does not properly forward the data to rows.com.

image

Which is going to be difficult to debug without, ahem, being able to use the dev-mode extension.

Anyway, better than before. More later.

@feep
Copy link
Contributor Author

feep commented Apr 23, 2024

Where do you want the safari bits?

  1. ./safari in this repo
  2. A different directory
  3. A different repo

For dev or CI, it should work fine within the repo or out of the repo. If in a separate repo, the chrome extension would need to keep a consistent path when building (../X/dist or something).

@ricardofelgueiras
Copy link
Contributor

Where do you want the safari bits?

  1. ./safari in this repo
  2. A different directory
  3. A different repo

For dev or CI, it should work fine within the repo or out of the repo. If in a separate repo, the Chrome extension would need to keep a consistent path when building (../X/dist or something).

You can create a safari folder specifically for this. We can take care of the build afterward. Don't forget to edit the tests and ensure these tests run for the Safari extension as well.

Additionally and to give you some context, it would be better to build the extension having the Manifest V3 in mind. This will allow us to create one single extension that works for the main browsers (Safari, Chrome, and Firefox).

@ricardofelgueiras
Copy link
Contributor

One hint for you to check why the Open in Rows doesn't work: check the permissions. The extension should be able to add information to the clipboard.

@feep
Copy link
Contributor Author

feep commented Apr 24, 2024

Additionally and to give you some context, it would be better to build the extension having the Manifest V3 in mind. This will allow us to create one single extension that works for the main browsers (Safari, Chrome, and Firefox).

The (production) extension builds into a Safari extension with no changes.

It will need a different UI on Safari, if you decide to deal with the clipboard issues (more in later comment).

@feep
Copy link
Contributor Author

feep commented Apr 24, 2024

check the permissions. The extension should be able to add information to the clipboard.

Yup. Sigh.

Safari requires user action to read the clipboard.

I think, still, on 17.3.1. Haven’t finished research.

Anyway, if that is true, it needs some UI work.

It works =]

Kinda.

  1. Click RowsX extension menu
  2. Click copy button (which dismisses the popover)
  3. Click RowsX extension menu again
  4. Click Open in Rows
  5. Paste

I will get a draft PR up later today with the Safari webextension build in ./safari.

@feep
Copy link
Contributor Author

feep commented Apr 26, 2024

Still poking around, trying to get clipboard permission.

Unhandled Promise Rejection: Error: Cannot access contents of the page. Extension manifest must request permission to access the respective host, or have "activeTab" permission with a user gesture.

I can get the permission request (a different one) to pop up on click (user gesture) on Chromium, but it won’t pop on Safari.

I will update #88 when I make visible progress.

@feep
Copy link
Contributor Author

feep commented May 28, 2024

Unable to get proper permissions.

Not much documented in Safari, and things I tried that popped an additional permission request in Chrome did not do anything useful in Safari.

May try again later.

Unassigning. If anyone picks this up, you are welcome to use #88 as a starting point.

Basically, this is where it stands.

As far as I am concerned, this bounty is open again.

@feep feep removed their assignment May 28, 2024
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

No branches or pull requests

3 participants