iOS seems to have an undocumented "feature" to call into javascript before every device orientation change (pasted below for your viewing pleasure).
I can't find any such similar functionality on other platforms, should it be removed? Likely we will want to write a screen orientation ( http://www.w3.org/TR/screen-orientation/) plugin instead (eventually). - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // First, ask the webview via JS if it supports the new orientation NSString* jsCall = [NSString stringWithFormat: @"window.shouldRotateToOrientation && window.shouldRotateToOrientation(%d);" , [self mapIosOrientationToJsOrientation:interfaceOrientation]]; NSString* res = [webView stringByEvaluatingJavaScriptFromString:jsCall]; if ([res length] > 0) { return [res boolValue]; } // if js did not handle the new orientation (no return value), use values from the plist (via supportedOrientations) return [self supportsOrientation:interfaceOrientation]; } -Michal
