• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
64bit Method Swizzling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: 64bit Method Swizzling
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: app delegate +initialize
  • Next by Date: Re: app delegate +initialize
  • Previous by thread: Re: Cocoa-dev Digest, Vol 6, Issue 1443
  • Next by thread: Re: 64bit Method Swizzling
  • Index(es):
    • Date
    • Thread