Esempio n. 1
0
        public void InstallScript(string url, string code)
        {
            var x    = ParseUserScript.Parse(code, false);
            var name = Utils.GetFileNameFromUrl(url);

            Utils.WriteFileAsync(ScriptPath + name, code);
            x.Path = ScriptPath + name;
            if (x.Name == String.Empty)
            {
                x.Name = "Userscript from " + url;
            }
            if (String.IsNullOrWhiteSpace(x.UpdateUrl))
            {
                x.UpdateUrl = url;
            }
            AddScript(x);
        }