1

I am making a userscript and stylesheet for a website. Because I want to have both stylesheet and script on Git, I am trying to load them from filesystem, rather then storing them in browser profile.

For Greasemonkey userscript, this was easy:

// ==UserScript==
// @name        Userscript loader
// @namespace   pleasetellmewhatthehellisthis
// @include     ... url ...
// @version     1
// @grant       none
// @require     file:///D:/xxx/xxxx/xxxx.js
// ==/UserScript==

But can I do the same with stylish?

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

1 Answers1

0

Since I didn't get a reply, I used Greasemonkey to do it:

// ==UserScript==
// @name        Style loader
// @namespace   pz
// @include     ...
// @version     1
// @resource    THE_CSS  file:///D:/xxx/xxx/styles.css
// @grant       GM_addStyle
// @grant       GM_getResourceText
// @run-at      document-start
// ==/UserScript==

var cssTxt  = GM_getResourceText ("THE_CSS");
console.log(cssTxt);
GM_addStyle (cssTxt);
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778