Load remote file in extension#112
Conversation
|
I did another experiments just now, and found that the Here are some denied examples:
|
|
@lucka-me Thank you for the reply It's been my understanding that having no If a website admin has a resource shared online and a restrictive cross origin policy (either explicit or by the lack of a policy), would the method in this PR fail to respect that policy? I am not sure how I feel about circumventing the header policy. This was a consideration when I originally, and somewhat reluctantly enabled the feature. It's possible that the current implementation is too restrictive or I expect too much from |
|
I'm not sure why they don't set the I investigated the Tampermonkey in Chrome, and no network activity was logged in the Dev Tools when updating a script in the extension's manager page, so I guess it load scripts from the extension and there won't be any CORS limitation. If other user script managers also do in the same way, some website admins may not notice the And here is maybe another perspective: The user scripts are downloaded and executed in different places (or origins?): they are downloaded in the manager page, but executed in the As for the |
|
I think your implementation is an improvement so I will roll it into a future update, hopefully the next one. I will investigate request cancellations as well. Thanks for bringing this to my attention, and I really appreciate the PR. |

Hello,
First of all, thank you for developing such a useful extension!
I noticed that the Add Remote and Update always fail with "updateURL unreachable", after some experiments I found it's because of the CORS policy: UserScripts loads remote files by JavaScript in the extension page, the origin is something like
safari-extension://xxx-xxx-xxx, which is (usually?) not allowed by Access-Control-Allow-Origin, therefore the fetch operation is denied by Safari.I changed it to load remote files in extension (Swift part) instead, and it works fine so far but still with some limitations:
I'm new to Swift, and not sure whether all my code works fine or not. Please let me know if there is anything needs to be fixed.
Sincerely.