[MediaWiki-l] Calling local scripts from common.js

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] Calling local scripts from common.js

Huji Lee
Hi,

In the old days (i.e. before ResourceLoader), one could load a user script
from their own local machine using something like
importScript('file:///home/user/script.js')

Today I tried to do something similar except that my script relies on RL
modules (such as OOjs UI, MediaWiki API, etc). I couldn't get it to work.
Some users on #mediawiki channel doubted it is at all possible to load a
local script that uses RL modules. One user suggested GreaseMonkey but even
that did not help. Note that I was using debug mode the entire time.

I was wondering if anyone has been successful doing what I desire, or knows
how it can be done. For the record, the script I was trying to run through
GM is at [1].

Thanks,

Huji

[1] https://fa.wikipedia.org/wiki/MediaWiki:Gadget-AfD.js
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Calling local scripts from common.js

Brian Wolff
On Thu, Oct 27, 2016 at 10:24 PM, Huji Lee <[hidden email]> wrote:

> Hi,
>
> In the old days (i.e. before ResourceLoader), one could load a user script
> from their own local machine using something like
> importScript('file:///home/user/script.js')
>
> Today I tried to do something similar except that my script relies on RL
> modules (such as OOjs UI, MediaWiki API, etc). I couldn't get it to work.
> Some users on #mediawiki channel doubted it is at all possible to load a
> local script that uses RL modules. One user suggested GreaseMonkey but even
> that did not help. Note that I was using debug mode the entire time.
>
> I was wondering if anyone has been successful doing what I desire, or knows
> how it can be done. For the record, the script I was trying to run through
> GM is at [1].
>
> Thanks,
>
> Huji
>
> [1] https://fa.wikipedia.org/wiki/MediaWiki:Gadget-AfD.js


I'm surprised that ever worked. Most (all?) web browsers disallow
remote websites from loading arbitrary files on your computer. If a
web browser allowed remote websites to load arbitrary file:// urls, it
would be a rather large security vulnerability.

--
Brian.

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l