-
Notifications
You must be signed in to change notification settings - Fork 214
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
Problem running JavaScript from iCloud #582
Comments
This situation should be irrelevant to your specific user script. One situation we currently know is that when the device space is insufficient, the automatic eviction mechanism of iCloud documents will cause the extension to not run as expected (when the save location is specified as the iCloud directory). The above situation has been tracked in #424. But based on the limited information you've provided, I can't be sure you're experiencing the same situation. If possible, please add more details and provide |
I don't find any errors in popup or native logs. Maybe I need to remove the extension and reinstall it and try with local scrips folder. |
Until more valid information is available, I cannot be of further assistance to you. It would be a good idea to try using a local folder. If you find anything new please keep commenting. Let me close this issue for now. |
I reinstalled UserScripts and now the popup opens without problems. The script is injected only after I open the browsers developer tools, though. I tried with an CSS script on the same page and it works without developer tools open. How could I check why doesn't the script inject? The script is like in my opening questions. |
Interesting, I don't know why it would have anything to do with whether or not devtools is opened. Try just using the simple script below and see if it works? // ==UserScript==
// @name DEMO.Alert-URL
// @description Demo user script alert URL.
// @author Userscripts
// @version 1.0.0
// @match *://*/*
// @grant none
// @inject-into content
// @run-at document-start
// ==/UserScript==
(function () {
"use strict";
alert("DEBUG.Alert-URL:\n\n" + location);
})(); |
OK, review your script again. |
It get's interesting. I added the alert-box in the beginning of the failing script and it is shown even when the tools are closed, but the buttons are not drawn until I open the developer tools and reload the page. The @run-at setting makes no difference. The page is a React application as far as I know, if that has something to do with the issue. |
Like I said above, did you check The code logic will like: if (document.readyState === "complete") {
yourFunc();
} else {
window.addEventListener('load', yourFunc);
} Also, any elements you add may be removed by the page script. |
I have Mac 12.6.8 with Safari 17.0 and UserScripts 4.4.5.
My scripts are stored in iCloud. I have at the moment only one JavaScript which loads very uncertainly. I have to reload the page many times to have the script finally inject.
The UserScripts interface is also often stuck as you see in the image:
The script is something like this:
The text was updated successfully, but these errors were encountered: