-
Notifications
You must be signed in to change notification settings - Fork 311
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
Increase the maximum size limit #360
Comments
For starters https://github.com/OpenUserJs/OpenUserJS.org/blob/3d78209c70dc58dabee4c12c6813781eb77e8b2c/models/settings.json#L4 is currently the maximum size. Secondly we already have an upload file option at https://openuserjs.org/user/add/scripts (middle column and 2nd row down "Upload Script"). In your case it's definitely beyond the current ~488KiB limit. @sizzlemctwizzle will need to approve any maximum size if it is changed since he pays the bills. Thirdly your script contains embedded images, css, and translations which would probably be better suited served outside of the user.js to minimize its drain on system and server resources (Think Fourthly are you saying you aren't getting a too large warning somewhere? e.g. have you successfully uploaded a ~2.3MiB file onto production? Now that you have the appropriate info if you feel like changing the subject line to a feature request that might be prudent. As it stands now it is unclear and may merit an INVALID label with a close. Thanks. See also:
|
I haven't seen that there was a setting to specify a maximum size limit, good to know. It's probably a good idea to present the file size limit to the user so there would be no confusion. Thank you for pointing out that you can update your current userscript by using the same feature as uploading a new userscript. I would also think that it would be a good idea to meantion that too. I was able to upload YouTube Center which exceeded the file size limit by using the upload button on https://openuserjs.org/user/add/scripts. Also even if I remove the translations and assets the file size would still exceed the maximum file size limit. The way YouTube Center is designed it's not possible to load the translations and assets asynchronously without breaking a lot of stuff as it works a little different than an ordinary userscript. I've changed the title to EDIT: I might be able to add the translation and assets to a separate javascript file with a variable that the will be accessible by using @require and then pass that variable through as an argument in the injection and then there shouldn't be problem. |
Confirmed. Target code bug at 1644a50#diff-664f851728e6fc6ec664075df484505cR74
Always a possibility with larger scripts... however you should try. Your hosting on GH can allow for those to be hosted and referenced there and also cut down on the bandwidth for your users.
See also: |
When you first mentioned that In recent changes to Firefox I've been forced to actually inject the whole YouTube Center script onto the page otherwise I wouldn't be able to access global JavaScript variables set by YouTube. So I could add the And as you also said I would be able to use Github to host the JavaScript file with the translations and assets. I could maybe also consider creating an empty JavaScript file with |
Have you tried Anthony's Content Scope Runner?
Stubs/wrappers can work too. :) |
…too large of files posted. Affects OpenUserJS#360
Actually I've written a library that I'm using with YouTube Center that does the exact same thing as Anthony's Content Scope Runner and it also makes it possible to use the GM API (https://openuserjs.org/libs/YePpHa/UserProxy/). |
I'm now using |
Kewl beans... let's leave this open for sizzle to see if he wants to change anything... I've fixered the bug you reported You still have some weird looking b64 data (clipped for brevity)
This would appear to be extra data and should have been tokenized by PNG if you optimized it... just a thought for a consideration of your users. :) |
You're right it should've been tokenized. I will try to see if I can do something about it. |
I had to set a maximum file size for uploads. If the value I chose isn't
|
When I tried the ~2.3MiB it took quite a while so that is probably something we should avoid. My concern is that more people are using UTF-8 characters in their source in which our ~488KiB is at worst case is ~122KiB since it's four bytes per char... this assumes everything is extended characters which won't always be the case. It would be awesome to expose/create the account creation date and have a timeout expiry on accounts... if they continue to keep logging in and contributing then we could increase this on the fly for certain users e.g. those who participate more based off their last contribution period but before expiry. USO had a 1MiB limit so at worst case there 256KiB with all extended characters. Just some thoughts out loud. Tried one with pasting ~2.3 MiB source and got a dependency error from formidable on the request. @YePpHa |
* Same as USO was... recommend no higher to keep scripts legit and encourage use of `@require` and `@resource` for those types of scripts. Closes OpenUserJS#360
* Spread some more icons around * Add max file size upload value to mustache and show on script/lib upload page as an info alert. Mentioned at #OpenUserJS#360 (comment) Applies to OpenUserJS#186
Would it be possible to have a case-by-case basis for the maximum script size? My userscript (which is currently hosted on greasyfork) currently sits at almost 3MB with comments, ~1.2MB without comments. It doesn't host any resources or any libraries, the size primarily comes from the ~3200 rules that exist in the script. Currently this fits under Greasyfork's 2MB limit, but I'm worried that within a year or so, it will surpass the limit as I find and add new rules to the script. Using |
Presuming you don't have greater than four spaces in-between JavaScript quotes/apostrophes/back-ticks (String Literals) that you need to keep, and Linux or compatible conversion (or and editor that will do it for you)... I get this for your script when converting spaces to tabs keeping comments from your "smaller" hosted version on GF: $ sed -e 's/ /\t/g' 'Image Max URL.user.js' > "Image Max URL.tabbed.user.js"
$ ls -l Image\ Max\ URL.*
*clipped* 915407 Sep 24 20:29 'Image Max URL.tabbed.user.js' # 0.873000145 MiB
*clipped* 1162418 Sep 24 19:32 'Image Max URL.user.js' # 1.108568192 MiB
$ awk "BEGIN {print (1.0 - 915407 / 1162418) * 100 }"
21.2498
$ # ... savings in percent (%) i.e. smaller One note on publishing to OUJS if you import your script from GH it should be able to be within the limits since it's a direct copy instead of Ace/formidable adjusted, or run into #793, and briefly alluded to up here. In short ... probably not, and it took about ~3-4 seconds for me to upload via file, but you have options atm. You will also need to change the
Stats: $ ls -l Image\ Max\ URL*
*clipped* 2544836 Sep 24 21:25 'Image Max URL.full.tabbed.user.js'
*clipped* 2951990 Sep 24 21:22 'Image Max URL.full.user.js'
*clipped* 2609 Sep 24 20:00 'Image Max URL imu.optimized.svg'
*clipped* 7497 Sep 24 21:14 'Image Max URL imu.svg'
*clipped* 18591 Sep 24 21:27 'Image Max URL logo.png'
*clipped* 915420 Sep 24 21:09 'Image Max URL.tabbed.user.js'
*clipped* 1162418 Sep 24 19:32 'Image Max URL.user.js' Keep in mind when most, if not all, the browsers force stricter limits on storage for the .user.js engine managers you might have another issue. |
Alright, good to know, and thank you very much for the ideas, I hadn't even thought about spaces->tabs! :) |
I am the developer of YouTube Center and when I'm trying to update YouTube Center on OpenUserJS I'm met with a problem, which is caused by the maximum request size of the browser (Error:
Request Entity Too Large
).The first time a userscript is created on OpenUserJS you have the ability to upload the userscript instead of copy/pasting it into a text field. I would request that this ability to upload the file will be added to the page when updating a userscript as YouTube Center minified has a size of ~2.3 MB (I know it's a lot, but it's also a big project).
Also I would probably be able to implement this feature into OpenUserJS myself, but I will just post this here before I begin to do a pull request.
The text was updated successfully, but these errors were encountered: