public ResourceTypeHelper() { mMimeMatcher = new MimeMatcher<Page.ResourceType>(); mMimeMatcher.addRule("text/css", Page.ResourceType.STYLESHEET); mMimeMatcher.addRule("image/*", Page.ResourceType.IMAGE); mMimeMatcher.addRule("application/x-javascript", Page.ResourceType.SCRIPT); // This is apparently important to allow the WebKit inspector to do JSON preview. I don't // know exactly why, but whatever. mMimeMatcher.addRule("text/javascript", Page.ResourceType.XHR); mMimeMatcher.addRule("application/json", Page.ResourceType.XHR); // Everything else gets a lame, unformatted blob. mMimeMatcher.addRule("text/*", Page.ResourceType.DOCUMENT); // I think this disables preview. Perhaps that's not what we want as the default but we'll // need some time to soak in real data to see for sure. mMimeMatcher.addRule("*", Page.ResourceType.OTHER); }