Skip to content

Instantly share code, notes, and snippets.

@moyashi
Created February 28, 2011 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moyashi/847513 to your computer and use it in GitHub Desktop.
Save moyashi/847513 to your computer and use it in GitHub Desktop.
Safariで表示中のWebViewにJavaScriptを実行させる
[[[[BrowserDocumentController sharedDocumentController] frontmostBrowserDocument] currentBrowserWebView] stringByEvaluatingJavaScriptFromString:@"alert(1)"];
@hirohitokato
Copy link

Class BrowserDocumentController = objc_getClass ("BrowserDocumentController");
id browserController = [BrowserDocumentController sharedDocumentController];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment