From: Jay Freeman (saurik) Date: Sat, 12 Sep 2015 16:25:38 +0000 (-0700) Subject: Avoid modifying stylesheets when updating @medias. X-Git-Tag: v0.9.5002~1 X-Git-Url: https://git.saurik.com/cydget.git/commitdiff_plain/c83c785e8d73fb9baccc7671c3b74be6ead04344 Avoid modifying stylesheets when updating @medias. --- diff --git a/WebCycript.mm b/WebCycript.mm index 3ab6d09..ed58f72 100644 --- a/WebCycript.mm +++ b/WebCycript.mm @@ -120,6 +120,8 @@ static bool iOS32, iOS4; @end @interface DOMDocument : NSObject +- (NSString *) selectedStylesheetSet; +- (void) setSelectedStylesheetSet:(NSString *)value; - (DOMStyleSheetList *) styleSheets; @end @@ -167,9 +169,8 @@ MSInstanceMessageHook0(BOOL, NSURL, isSpringboardHandledURL) { @implementation UIWebView (WebCycript) - (void) updateStyles { - DOMCSSStyleSheet *sheet([[[[[[self _documentView] webView] mainFrame] DOMDocument] styleSheets] item:0]); - [sheet addRule:@"cydget" style:@"color: black" index:0]; - [sheet deleteRule:0]; + DOMDocument *document([[[[self _documentView] webView] mainFrame] DOMDocument]); + [document setSelectedStylesheetSet:[document selectedStylesheetSet]]; } @end