admin管理员组文章数量:1320781
I would like to write an application in JavsScript that runs natively on OS X. It would be a bonus if it could be used for Windows apps as well, however I am primarily interested in the OS X / Cocoa tie in initially.
I was entertaining the possibility of writing all of the business logic in JS and then the primary UI ponents with Cocoa and .NET respectively, but I got to thinking that it would be nice if there were something already in place that would facilitate such a workflow without having to support a few different codebases.
After researching this a bit, I obviously became overwhelmed with the solutions that seem to exist for iOS development, however hitherto I've found nothing that really seems to also work on OS X. Are there any solutions that I may be overlooking? If not, what might be the remended path for basing most business logic in a JavaScript app and interfacing with that for the native UI ponents?
I would like to write an application in JavsScript that runs natively on OS X. It would be a bonus if it could be used for Windows apps as well, however I am primarily interested in the OS X / Cocoa tie in initially.
I was entertaining the possibility of writing all of the business logic in JS and then the primary UI ponents with Cocoa and .NET respectively, but I got to thinking that it would be nice if there were something already in place that would facilitate such a workflow without having to support a few different codebases.
After researching this a bit, I obviously became overwhelmed with the solutions that seem to exist for iOS development, however hitherto I've found nothing that really seems to also work on OS X. Are there any solutions that I may be overlooking? If not, what might be the remended path for basing most business logic in a JavaScript app and interfacing with that for the native UI ponents?
Share Improve this question asked Jun 5, 2013 at 19:06 ylluminateylluminate 12.4k17 gold badges82 silver badges161 bronze badges 2- I guess you could make a simple app that is just a fullscreen web browser without an address bar or something, then download the HTML and CSS and JS in your app then automatically set the web browser to go to the main HTML page on startup – tckmn Commented Jun 5, 2013 at 19:11
- crx web apps for chrome, manifests for firefox, and adobe AIR are all cross-platform dev environments using JS that will work on mac and pc. – dandavis Commented Jun 5, 2013 at 19:23
2 Answers
Reset to default 5This is being a hot topic. I suggest you read this article about a JavaScript Objective-C bridge for OS 10.9. Also, check out this code sample from Apple in which the application controller is simply responsible for municating between objects and JavaScript is really driving everything. The sample is called JavaScriptCoreHeadstart and Apple describes it as follows:
JavaScriptCore is a new system framework available in Mac OS X 10.5 that allows applications to run JavaScripts. This sample shows one way to use JavaScriptCore for providing user configurable features in a Cocoa application. Here, a number of JavaScript objects are defined that represent various parts of the application and the application's controller is really just a thin shell that calls JavaScripts that decide how the application will operate in response to Interface Builder action method calls and WebKit delegate callbacks. The JavaScripts themselves control the application through the objects that represent different parts of the application.
There is NodObjC that should allow you to write Cocoa applications for NodeJS.
本文标签: javascriptNative OS X apps in JSStack Overflow
版权声明:本文标题:javascript - Native OS X apps in JS? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742090247a2420221.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论