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

[RFC] Officially Support Safari target #233

Open
3 tasks done
louisgv opened this issue Sep 25, 2022 · 11 comments
Open
3 tasks done

[RFC] Officially Support Safari target #233

louisgv opened this issue Sep 25, 2022 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@louisgv
Copy link
Contributor

louisgv commented Sep 25, 2022

How do you envision this feature/change to look/work like?

When specifying --target=safari-mv3, it should spit out an actual XCode project suitable to be used on Safari

What is the purpose of this change/feature? Why?

Without freedom of choice there is no creativity

(OPTIONAL) Example implementations

No response

(OPTIONAL) Contact Details

No response

Verify canary release

  • I verified that the issue exists in plasmo canary release

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@louisgv louisgv added the enhancement New feature or request label Sep 25, 2022
@louisgv louisgv self-assigned this Sep 25, 2022
@louisgv louisgv pinned this issue Sep 25, 2022
@louisgv louisgv unpinned this issue Oct 23, 2022
@louisgv louisgv pinned this issue Oct 30, 2022
@louisgv
Copy link
Contributor Author

louisgv commented Nov 21, 2022

https://developer.apple.com/documentation/safariservices/safari_web_extensions/developing_a_safari_web_extension

@louisgv
Copy link
Contributor Author

louisgv commented Nov 21, 2022

@ColdSauce according to their sample example - there's a layer of native messaging with the host browser which is interesting. Tho, for the shake of brevity, I wonder how much can we reduce from their example to have the popup sample extension working in Safari?

@tyn1998
Copy link

tyn1998 commented Nov 23, 2022

really looking forward to this wonderful feature!

@wangrongding
Copy link
Contributor

really looking forward to this wonderful feature! +1🤖

@process1024
Copy link
Contributor

process1024 commented Dec 14, 2022

I have successfully converted plasmo extension to safari, change the egines config of parcel to "IE 11", build mv2 and then use safari-web-extension-converter, then it works, see this pr337

@louisgv
Copy link
Contributor Author

louisgv commented Dec 15, 2022

@process1024 AFAIK, the safari converter uses the old MV2 format which is largely deprecated. The latest Safari webkit version support MV3. We should head there eventually imo, but the stop-gaps solution should help extension to move to safari with the provided converter

@ColdSauce ColdSauce unpinned this issue Mar 2, 2023
@g-sam
Copy link

g-sam commented Sep 1, 2023

Having gone through the Safarification process, I don't think Plasmo should include generation of the xcode project in it's build. There are various reasons developers might want control over the xcode project (e.g. altering the native app to display a different message) and it's faster if the project is already there. For an MVP all Plasmo needs to do I think is trigger a custom command after repacking in dev to compile and install the xcode project. It would probably help people to document the required xcode commands as they are poorly documented by apple.

Plasmo could perhaps take care of the one-off generation of the xcode project and modify the default output in some useful ways. Main modifications I found useful: (a) create separate xcode targets for Dev and prod and mv2 and mv3, (b) replace the bundle resources build step with a run script which copies the files from the relevant plasmo build directory, which avoids the need to manually manage resources in the xcode project.

Now if Plasmo could work out a way to update the resources in the installed app package on the fly from the dev server, that would be amazing - no need to recompile/install if the native parts haven't changed.

@spookyuser
Copy link

Another issue i just noticed is that web workers in safari don't work with plasmo, well parcel.

Parcel seems to do this thing where it throws an error to find the bundle url:

https://github.com/parcel-bundler/parcel/blob/2215d360dc531ec46c112223763404650b0a8be1/packages/runtimes/js/src/helpers/bundle-url.js#L15

Which in safari just results in webkit-masked-url://hidden/ (https://bugs.webkit.org/show_bug.cgi?id=246010)

@morganwu277
Copy link

morganwu277 commented Apr 2, 2024

url importurl:/xxxx still have issues for content scripts in safari target

@tnagss
Copy link

tnagss commented Aug 1, 2024

url importurl:/xxxx still have issues for content scripts in safari target

is there any workaround available for safari?

@naan
Copy link

naan commented Aug 1, 2024

url importurl:/xxxx still have issues for content scripts in safari target

is there any workaround available for safari?

I have the same problem, and I used data-text or data-base64 for loading stylesheets and images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants