Coder Social home page Coder Social logo

Better Userscript support about vencord HOT 12 CLOSED

vendicated avatar vendicated commented on May 10, 2024 1
Better Userscript support

from vencord.

Comments (12)

grant avatar grant commented on May 10, 2024 33

Hi Mister grant sorry for pinging you 🚎

Hi Ven, it's ok. I get about 1 ping every day because of my name. You are the first to apologize in advance. Have a good day!

from vencord.

MeguminSama avatar MeguminSama commented on May 10, 2024 2

it would be trivial to have a gh action compile vencord and create a build artifact that can be used for the downloadURL

from vencord.

Cynosphere avatar Cynosphere commented on May 10, 2024

Violentmonkey on Firefox currently has an issue where Object.defineProperty on window at @run-at document-start doesn't work, meaning webpack patching won't work.

Workarounds

from vencord.

lol219 avatar lol219 commented on May 10, 2024

Itls à good idea

from vencord.

Vendicated avatar Vendicated commented on May 10, 2024

Added in d26196d

Works fine except that Firefox ViolentMonkey bug cyn mentioned. Also runs into csp issues when trying to fetch external urls like github/unpkg

I am not sure how to fix these two issues

from vencord.

Vendicated avatar Vendicated commented on May 10, 2024

I don't think there's a way to fix the CSP issue without doing a big refactor to use a @grant which means window -> unsafeWindow and it just overcomplicates things. I solved the issue in the proper browser addon by making a background script but this is not possible in UserScripts. The best solution would probably to use an anti csp extension like this one (Disclaimer: I never used it and have no idea whether it works and is safe) unless someone else has a better idea / could contribute a solution.
In any case, CSP bypass isn't even that important, only minor features like petpets dynamic library import from cdn don't work so I think it's fine

from vencord.

Vendicated avatar Vendicated commented on May 10, 2024

Hi Mister grant sorry for pinging you 🚎

from vencord.

kiriya-aoi avatar kiriya-aoi commented on May 10, 2024

For the purposes of having a version number that increments for auto-updating the userscript, could we use the commit number via e.g. git describe?

from vencord.

Vendicated avatar Vendicated commented on May 10, 2024

Doesn't its updating system use semver?

from vencord.

Vendicated avatar Vendicated commented on May 10, 2024

Updating should work now since it just uses the current timestamp as version. I don't think csp bypass is doable from userscript, so this issue is basically done now

from vencord.

gBasil avatar gBasil commented on May 10, 2024

Aren't there several userscript APIs to circumvent CSP in some cases? GM_addElement, GM_getResourceURL, and GM_xmlhttpRequest.

from vencord.

Vendicated avatar Vendicated commented on May 10, 2024

please don't necro old resolved issue threads. this issue is more than a year old

yes, those would likely work for some use cases, but that would require us to write specialised UserScript code, which is out of scope, and would still not cover some other use cases. not to mention, tampermonkey already seems to have workarounds for csp issues with which multiple people reported success

from vencord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.