dece4b57f3
Fix: handle dup name+namespace Fix: eslint eqeqeq Fix: trim @name's spaces Add: check update for userstyle Add: build CSS variable Fix: only check dup when id is not provided Refactor: userStyle2json -> userstyle.json Add: style for input Add: config dialog Fix: preserve config during update Fix: onchange doesn't fire on keyboard enter event Fix: remove empty file Add: validator. Metas must stay in the same line Add: warn the user if installation failed Fix: add some delay before starting installation Add: open the editor after first installation Fix: add openEditor to globals Fix: i18n Add: preprocessor. Move userstyle.build to background page. Fix: remove unused global Fix: preserved unknown prop in saveStyleSource() like saveStyle() Add: edit userstyle source Fix: load preprocessor dynamically Fix: load content script dynamically Fix: buildCode is async function Fix: drop Object.entries Fix: style.sections is undefined Fix: don't hide the name input but disable it Fix: query the style before installation Revert: changes to editor, editor.html Refactor: use term `usercss` instead of `userstyle` Fix: don't show homepage action for usercss Refactor: move script-loader to js/ Refactor: pull out mozParser Fix: code style Fix: we don't need to build meta anymore Fix: use saveUsercss instead of saveStyle to get responsed error Fix: last is undefined, load script error Fix: switch to moz-format Fix: drop injectContentScript. Move usercss check into install-user-css Fix: response -> respond Fix: globals -> global Fix: queryUsercss -> filterUsercss Fix: add processUsercss function Fix: only open editor for usercss Fix: remove findupUsercss fixme Fix: globals -> global Fix: globals -> global Fix: global pollution Revert: update.js Refactor: checkStyle Add: support usercss Fix: no need to getURL in background page Fix: merget semver.js into usercss.js Fix: drop all_urls in match pattern Fix: drop respondWithError Move stylus -> stylus-lang Add stylus-lang/readme Fix: use include_globs Fix: global pollution
35 lines
824 B
JavaScript
35 lines
824 B
JavaScript
'use strict';
|
|
|
|
// eslint-disable-next-line no-var
|
|
var loadScript = (function () {
|
|
const cache = new Map();
|
|
|
|
return function (path) {
|
|
if (!path.includes('://')) {
|
|
path = chrome.runtime.getURL(path);
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
if (cache.has(path)) {
|
|
resolve(cache.get(path));
|
|
return;
|
|
}
|
|
const script = document.createElement('script');
|
|
script.src = path;
|
|
script.onload = () => {
|
|
resolve(script);
|
|
script.onload = null;
|
|
script.onerror = null;
|
|
|
|
cache.set(path, script);
|
|
};
|
|
script.onerror = event => {
|
|
reject(event);
|
|
script.onload = null;
|
|
script.onerror = null;
|
|
script.parentNode.removeChild(script);
|
|
};
|
|
document.head.appendChild(script);
|
|
});
|
|
};
|
|
})();
|