コード例 #1
0
 private static void OverrideStylesheet_BeforeResponse(Fiddler.Session oSession)
 {
     if (oSession.fullUrl != Properties.Settings.Default.KanColleGamePage.AbsoluteUri)
     {
         return;
     }
     oSession.utilDecodeResponse();
     oSession.utilReplaceInResponse("</head>", Properties.Settings.Default.TagOverrideStylesheet + "</head>");
 }
コード例 #2
0
 private static void NoTouchActionStylesheet_BeforeResponse(Fiddler.Session oSession)
 {
     if (!Models.Settings.Current.DisableBrowserTouchAction)
     {
         return;
     }
     if (oSession.fullUrl != uri)
     {
         return;
     }
     oSession.utilDecodeResponse();
     oSession.utilReplaceInResponse("</head>", Properties.Settings.Default.TagNoTouchAction + "</head>");
 }
コード例 #3
0
        private static void QualityScript_BeforeResponse(Fiddler.Session oSession)
        {
            if (!oSession.url.Contains("osapi.dmm.com/gadgets/ifr?"))
            {
                return;
            }

            var q = Models.Settings.Current.FlashQuality;
            var m = Models.Settings.Current.FlashRenderMode;

            oSession.utilDecodeResponse();
            oSession.utilReplaceInResponse("</head>", string.Format(Properties.Settings.Default.TagQualityShim, q, m) + "</head>");
        }
コード例 #4
0
        public static Session FiddlerSessionToSession(Fiddler.Session fSession)
        {
            Session s = new Session();

            //Set the host.
            s.Host = fSession.host;
            //Setup the request.
            s.Request.HttpMethod = fSession.oRequest.headers.HTTPMethod;
            s.UriScheme          = fSession.oRequest.headers.UriScheme;
            s.Request.Path       = fSession.oRequest.headers.RequestPath;
            s.Id = fSession.id;
            foreach (Fiddler.HTTPHeaderItem header in fSession.oRequest.headers)
            {
                s.Request.Headers.Add(header.Name, header.Value);
            }
            s.Request.BodyBytes = fSession.requestBodyBytes;

            //Setup up the resposne.
            if (fSession.oResponse != null && fSession.oResponse.headers != null && fSession.responseBodyBytes != null && fSession.responseBodyBytes.Length > 0)
            {
                foreach (Fiddler.HTTPHeaderItem header in fSession.oResponse.headers)
                {
                    s.Response.Headers.Add(header.Name, header.Value);
                }
                fSession.utilDecodeResponse();
                s.Response.BodyBytes = fSession.responseBodyBytes;
            }

            if (fSession.oFlags[UASettings.casabaFlag] != null && fSession.oFlags[UASettings.casabaFlag].Length > 0)
            {
                s.ContainsCodePoint = true;
                s.Chr = new UAUnicodeChar(fSession.oFlags[UASettings.casabaFlag][0]);
                s.Flags[UASettings.casabaFlag] = fSession.oFlags[UASettings.casabaFlag];
            }
            //MessageBox.Show(fSession.fullUrl);
            //s.Fsession= fSession;
            return(s);
        }