]> git.saurik.com Git - cydget.git/commitdiff
Avoid modifying stylesheets when updating @medias.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 12 Sep 2015 16:25:38 +0000 (09:25 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 12 Sep 2015 16:25:38 +0000 (09:25 -0700)
WebCycript.mm

index 3ab6d095fc0495715c11ae3fa2e380af8ff627b0..ed58f728e32356edc9418d43b9e70477c3c235ea 100644 (file)
@@ -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