Windows 8 & JavaScript

4,159 views
4,025 views

Published on

Slides from my talk at JSinSA - the first part (all lolcat

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,159
On SlideShare
0
From Embeds
0
Number of Embeds
140
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Windows 8 & JavaScript

  1. 1. Building Windows 8 applications with JavaScript  JavaScript by Robert MacLean
  2. 2. Hi 
  3. 3. TodayTomorrow
  4. 4. Windows 8?
  5. 5. Metro Design vs. Metro Apps
  6. 6. Why a Metro App?
  7. 7. Browsers in Windows 8
  8. 8. Marketplace
  9. 9. Windows Runtime
  10. 10. WinJS
  11. 11. Your tools & knowledge
  12. 12. SummaryWindows 8 is comingModern way for users to work,modern way for developers to buildJavaScript & HTML 5 is FIRST CLASSQuestions?
  13. 13. Contact DetailsRobert MacLeanrobert@sadev.co.za073 142 5422@rmacleanhttp://www.sadev.co.za
  14. 14. Out this year 100 000 new & improved featuresBig focuses on the future Consumerisation of IT Tablets ARM supportNew development options and tools
  15. 15. MetroMetro design & “Metro apps” are differentDesign matters Common language for design Common UX for Microsoft Xbox Windows Windows Phone Not going to be covered in this talk
  16. 16. Benefits of Metro AppsTrust Sandboxed User is in control Opt-in for featuresTake advantage of Windows RTfeaturesCross CPU supportBacked by the cloudEasy for users to get, install andmigrate apps Marketplace Windows Live
  17. 17. Browsers in Windows 8Internet Explorer 10 Metro App & Traditional Desktop Application Metro is plug in free Expect it to be better than IE 9, in every way Microsoft has a new model for developmentFirefox & Chrome Metro App & Traditional Desktop Application Mozilla & Google getting special permissions & working with Microsoft
  18. 18. Hardware Accelerated in IE 9 & IE 10
  19. 19. MarketplaceApp store, like any otherProcess Submission Testing & Approval by Microsoft Profit Free Adverts Trials (limited time & limited features) In App Purchases
  20. 20. Windows Runtime (WinRT)Win32 API is twenty years old Different world & different devicesWinRT built from ground upModern thinking, “stolen”from best of breed Mobile Async .NET & JavaAll languages are first class
  21. 21. WinJSProject the Windows Runtime intoJavaScriptWinJS – implemented as Core library UI library Resource libraries Style sheetsNot portable, even to Windows 8browsersProjectable to Windows Metadata Can be consumed in other languages
  22. 22. Your favourite librariesThis is real JavaScriptYour patterns move acrossYour libraries move across Be careful of cross domain checks Some additional security See hidden slides
  23. 23. jQuery, XHR and local context• jQuery xhr does a cross-domain check (in > v1.6) – In local context, your origin is “ms- wwa://{something}” – Cross domain check fails• Workarounds – Use WinJS XHR – Tell jQuery to bypass the check • $.support.cors = true; • http://api.jquery.com/jQuery.support/
  24. 24. Host Enforcement• Prevents potentially “bad” HTML from getting inserted – Script blocks, iframes, event handlers, etc.• Kicks in when setting strings – innerHTML – outerHTML – setAdjacentHTML• “data-” attributes in general not on the allowed list – WinJS specific ones are ok
  25. 25. Host Enforcement Escape Hatches• Can work around when needed: – toStaticHTML method – Use DOM creation APIs – Use WinJS.Utilities.setInnerHTMLUnsafe – Use msWWA.execUnsafeLocalFunction

×