diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 6af7622fa..b19719780 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -27,7 +27,7 @@ namespace v8_extensions { "exists", "read", "write", "absolute", "getAllFilePathsAsync", "traverseTree", "isDirectory", "isFile", "remove", "writeToPasteboard", "readFromPasteboard", "quit", "watchPath", "unwatchPath", "getWatchedPaths", "unwatchAllPaths", "makeDirectory", "move", "moveToTrash", "reload", "lastModified", - "md5ForPath", "exec", "getPlatform", "setWindowState", "getWindowState" + "md5ForPath", "exec", "getPlatform", "setWindowState", "getWindowState", "isMisspelled" }; CefRefPtr nativeObject = CefV8Value::CreateObject(NULL); @@ -521,6 +521,13 @@ namespace v8_extensions { return true; } + else if (name == "isMisspelled") { + NSString *word = stringFromCefV8Value(arguments[0]); + NSRange range = [[NSSpellChecker sharedSpellChecker] checkSpellingOfString:word startingAt:0]; + retval = CefV8Value::CreateBool(range.length > 0); + return true; + } + return false; };