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

When debugging on IOS GM functions are undefined #144

Open
Thorvarium opened this issue Mar 29, 2024 · 9 comments
Open

When debugging on IOS GM functions are undefined #144

Thorvarium opened this issue Mar 29, 2024 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@Thorvarium
Copy link

Thorvarium commented Mar 29, 2024

import { GM_setValue, GM_getValue, GM_info } from "$"; returns undefined while on android it returns correctly

To connect iphone to the local server I am using "vite-plugin-mkcert" and installing the PEM SSL certificate on the iphone. Same for android

@lisonge
Copy link
Owner

lisonge commented Mar 30, 2024

When debugging on IOS

What is your userscript manager ?

and I don't have an ios device, I may not be able to give you a solution, you can pr if you can solve it

@lisonge lisonge added the help wanted Extra attention is needed label Apr 1, 2024
@Thorvarium
Copy link
Author

When debugging on IOS

What is your userscript manager ?

and I don't have an ios device, I may not be able to give you a solution, you can pr if you can solve it

The scriptmanager on iphone is an app called "Stay" that also let you add scripts. I am not sure how to start debugging. How does it inject the GM functions normally? It does work on iphone after building. The issue is during dev serve

@lisonge
Copy link
Owner

lisonge commented Apr 3, 2024

I am not sure how to start debugging

You can check the console full output

@Thorvarium
Copy link
Author

Thorvarium commented Apr 10, 2024

I am not sure how to start debugging

You can check the console full output

I think that safari doesn't like setting properties in the Window itself. The only way that I could pass GM inside is setting inside the unsafe Document. Even when I set other property names, monkeyWindow.XXX is always undefined

@bbb651
Copy link

bbb651 commented May 19, 2024

I highly recommend this app for userscripts on iOS, it's open source, completely free without ads and has support for GM. apis.

@Thorvarium
Copy link
Author

I highly recommend this app for userscripts on iOS, it's open source, completely free without ads and has support for GM. apis.

I will try again soon, I did try it last time and had the same issues with passing gm from monkey. Also, I am not a fan how you need to put things inside the Icloud folder, it is a lot more complicated to give user instalation instructions

@Thorvarium
Copy link
Author

Thorvarium commented May 20, 2024

If I am not mistaken, the UserScript app is even more complicated to debug monkey because you can't pass at all the gm functions to unsafe. You need to create a messaging structure and pass messages between the windows and use the gm funcions inside the UserScript part of the code

@bbb651
Copy link

bbb651 commented May 20, 2024

I highly recommend this app for userscripts on iOS, it's open source, completely free without ads and has support for GM. apis.

I will try again soon, I did try it last time and had the same issues with passing gm from monkey. Also, I am not a fan how you need to put things inside the Icloud folder, it is a lot more complicated to give user instalation instructions

It doesn't have to be an iCloud folder it can be any folder (e.g a local folder, a different cloud storage provider), and I wouldn't say it's "a lot more complicated", the files app isn't a new thing on iOS and even people who aren't familiar with it know what files are. It literally 2 steps: save the file to a folder, select the folder.

@Thorvarium
Copy link
Author

Thorvarium commented May 24, 2024

I highly recommend this app for userscripts on iOS, it's open source, completely free without ads and has support for GM. apis.

I will try again soon, I did try it last time and had the same issues with passing gm from monkey. Also, I am not a fan how you need to put things inside the Icloud folder, it is a lot more complicated to give user instalation instructions

It doesn't have to be an iCloud folder it can be any folder (e.g a local folder, a different cloud storage provider), and I wouldn't say it's "a lot more complicated", the files app isn't a new thing on iOS and even people who aren't familiar with it know what files are. It literally 2 steps: save the file to a folder, select the folder.

I've tested here, works good on the compiled script. But it doesn't work on run dev mode to debug. They have protections to not allow GM functions to be sent thru the window from what I've been reading on their github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants