64bit Method Swizzling
64bit Method Swizzling
- Subject: 64bit Method Swizzling
- From: Russell Gray <email@hidden>
- Date: Thu, 8 Oct 2009 15:02:23 +1100
Hi all,
I am collaborating on getting a 64bit working version of Safari
Adblock via SIMBL. and we have it working..... kind of.....
sometimes.....
the Method Swizzling is where we are getting caught out.
we have the following code, which should work - however it doesn't.....
//Ad swizzling
MethodSwizzle(NSClassFromString(@"NSLoadProgressMonitor"),
@selector
(webView:resource:willSendRequest:redirectResponse:fromDataSource:),
@selector
(adblock_webView:resource:willSendRequest:redirectResponse:fromDataSource
:));
MethodSwizzle(NSClassFromString(@"NSLocationChangeHandler"),
@selector(webView:didFinishLoadForFrame:),
@selector(adblock_webView:didFinishLoadForFrame:));
// Toolbar swizzling
MethodSwizzle(NSClassFromString(@"ToolbarController"),
@selector
(toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:),
@selector
(adblock_toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:));
MethodSwizzle(NSClassFromString(@"ToolbarController"),
@selector(toolbarAllowedItemIdentifiers:),
@selector(adblock_toolbarAllowedItemIdentifiers:));
}
The Method Swizzle functions are good, as we Swizzle NSPreferences.
(to insert the Preference pane) and it works as expected.
the net is a different place when you have to wade through all the
ads, and I prefer to use Safari.
can anyone help?
here is the source code also, for reference:
http://github.com/mgee/safariadblock
Cheers in advance,
Russell
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden