Beispiel #1
0
        public static ActionResult MakeChromeManifest(Session session)
        {
            string dest = session["destpath"];

            BaseJSON b = new BaseJSON
            {
                name        = session["name"],
                description = session["description"],
                path        = session["path"],
                type        = session["type"]
            };

            ChromeJSON c        = ChromeJSON.Derive(b, session["allowed_origins"]);
            string     jsonData = c.ToJSON();

            try
            {
                System.IO.File.WriteAllText(dest, jsonData);
            }
            catch (Exception ex)
            {
                session.Log("ERROR Writing File");
                session.Log(ex.ToString());
                return(ActionResult.Failure);
            }

            session.Log("DONE");

            return(ActionResult.Success);
        }
Beispiel #2
0
        public static FirefoxJSON Derive(BaseJSON b, string ae)
        {
            List <string> allowed_extensions = new List <string>(ae.Split(';'));

            return(new FirefoxJSON
            {
                name = b.name,
                description = b.description,
                path = b.path,
                type = b.type,
                allowed_extensions = allowed_extensions
            });
        }
Beispiel #3
0
        public static ChromeJSON Derive(BaseJSON b, string ao)
        {
            List <string> allowed_origins = new List <string>(ao.Split(';'));

            return(new ChromeJSON
            {
                name = b.name,
                description = b.description,
                path = b.path,
                type = b.type,
                allowed_origins = allowed_origins
            });
        }