Is there a way to have a userscript load .css, .jpg, .png, etc files from the local computer rather than having them to be hosted on a server somewhere?
Like instead of Loading from www.blahblahblah.com/smile.png have it load it from C:\Users\Blah\Userscriptstuff\smile.png?
May 7, 2016 02:22 PM
(This post was last modified: May 7, 2016 02:26 PM by Hash G..)
And how this resource would come to the disk if not downloaded by an external server?
Anyway, I don't think it's possible as it tries to load the image from the server in any case.
Edit :
It'd maybe be possible using
// @require file://C:\Users\Folder\Desktop\...
These files are already cached depending on the browser. There's no point in doing it yourself, as the user could always just re-download the images.
Unless you're just doing it for testing, in which case you should just use imgur or something.
DO NOT DEAL WITH THIS MEMBER
Maybe this could help: https://hackforums.net/showthread.php?tid=5230469 But I don't know if I get what you mean.
(May 8, 2016 11:23 AM)glitchgxd Wrote: These files are already cached depending on the browser. There's no point in doing it yourself, as the user could always just re-download the images.
Unless you're just doing it for testing, in which case you should just use imgur or something.
The server where the files where hosted doesn't exist anymore. I cant see having to pay for hosting and domain if I can just host the required files locally.
Its for using blackreign (HF Old School) on my end.
These modern themes hurt my eyes after about 10 minutes.
(May 8, 2016 07:13 PM)mrnapolean1 Wrote: The server where the files where hosted doesn't exist anymore. I cant see having to pay for hosting and domain if I can just host the required files locally.
Its for using blackreign (HF Old School) on my end.
These modern themes hurt my eyes after about 10 minutes.
That should be easy enough then.
Just make the script replace the website file directory with the directory where you placed the files on your computer.
For instance, if you place all the images in C:\files\mywebsite\images and the site loads its images from mywebsite.com/images, make a script that replaces all instances of mywebsite.com/images with C:\files\mywebsite\images.
You're allowed to specify direct file paths for css/js/images/etc (as long as they're on your actual computer).
Base64 encode the assets you need and you won't have to worry. This of course does make things a little slower, mind you, since base64 encoded assets cannot be cached.
(May 10, 2016 12:36 PM)~Dec Wrote: Base64 encode the assets you need and you won't have to worry. This of course does make things a little slower, mind you, since base64 encoded assets cannot be cached.
I ended up creating a free account with SPAM.
I recreated the theme and I am hosting it on my end.
SPAM isn't the best but I cant afford hosting or domain right now.
May 10, 2016 02:06 PM
(This post was last modified: May 10, 2016 02:11 PM by Aveling.)
How much files are you currently hosting at that SPAM website?
Try https://pages.github.com/ to create yourself a decent website host, its most likely faster then SPAM and its more reliable in my opinion.
I could host the files on my website but I won't be able to give you an account to access your files unfortunately.
(May 10, 2016 02:06 PM)Aveling Wrote: How much files are you currently hosting at that SPAM website?
Try https://pages.github.com/ to create yourself a decent website host, its most likely faster then SPAM and its more reliable in my opinion.
I could host the files on my website but I won't be able to give you an account to access your files unfortunately.
I just used SPAM because I already had an account created there.
Ill check into github pages.
Do they offer domains as well?
(May 10, 2016 02:19 PM)mrnapolean1 Wrote: I just used SPAM because I already had an account created there.
Ill check into github pages.
Do they offer domains as well?
You will get a http://username.github.io which isn't that bad actually.
May 10, 2016 04:57 PM
(This post was last modified: May 11, 2016 05:25 PM by mrnapolean1.)
(May 10, 2016 02:20 PM)Aveling Wrote: You will get a http://username.github.io which isn't that bad actually.
Ill look into it tomorrow. If I decide to go with github It will not take me long to change the URLs in my userscript.
(May 10, 2016 02:20 PM)Aveling Wrote: You will get a http://username.github.io which isn't that bad actually.
I cant figure it out.
I think ill stay where I am at till I get some money to get better hosting and domain.
Ended up coming back to Github and I am making my way around now.
|