Discovering WKWebView
|
|
- Marianna May
- 5 years ago
- Views:
Transcription
1
2 Discovering WKWebView
3
4 Designed to replace UIWebView on ios and WebView on macos.
5 Both ios and macos have the same API
6 Harder to use than UIWebView
7 Multi-process Architecture
8
9
10
11 Multi-process Architecture Full WebKit Responsive Energy Efficient
12 Other Benefits Fast Javascript Built in Gestures Easy Web Page Communication
13
14 if let url = URL(string: " { webview.load(urlrequest(url:url ))
15 let html = """ <html> <head> <title>hello MODS 2017</title> </head> <body> <h1>hello MODS 2017</h1> </body> </html> """ webview.loadhtmlstring(html, baseurl: nil)
16 WKWebView Properties title url isloading estimatedprogress
17 Customized Page Loading
18
19
20 WKNavigationDelegate
21 webview.navigationdelegate = self
22 import UIKit import WebKit extension ViewController: WKNavigationDelegate {
23 An Example
24
25 <tr class="townrow" > <td class="town"> <a href=" title="achhnera"> Achhnera </a> </td> <td class="state"> <a href=" title="uttar Pradesh"> Uttar Pradesh </a> </td> <td class="population"> 22,781 </td> </tr>
26
27 import UIKit import WebKit extension ViewController: WKNavigationDelegate { func webview(_: WKWebView, decidepolicyfor: WKNavigationAction, (WKNavigationActionPolicy) -> Void) {
28
29 WKNavigationAction request sourceframe targetframe buttonnumber modifierflags navigationtype
30 WKNavigationType linkactivated formsubmitted backforward reload formresubmitted other
31 Our Example We want to interrupt the flow when a link is clicked (linkactivated) for a wikipedia url (request)
32 func webview(_: WKWebView, decidepolicyfor: WKNavigationAction, (WKNavigationActionPolicy) -> Void) { // If we are loading for any reason other than a link activated // then just process it. guard decidepolicyfor.navigationtype ==.linkactivated else { decisionhandler(.allow) return
33 func webview(_: WKWebView, decidepolicyfor: WKNavigationAction, (WKNavigationActionPolicy) -> Void) { // If we are loading for any reason other than a link activated // then just process it. guard decidepolicyfor.navigationtype ==.linkactivated else { decisionhandler(.allow) return // Reroute any request for wikipedia out to the default browser // then cancel the request. let request = decidepolicyfor.request if let url = request.url, let host = url.host, host == "en.m.wikipedia.org" { UIApplication.shared.open(url, options: [:], completionhandler: nil) decisionhandler(.cancel) return // By default allow the other requests to continue decisionhandler(.allow)
34 // Reroute any request for wikipedia out to the default browser // then cancel the request. let request = decidepolicyfor.request if let url = request.url, let host = url.host, host == "en.m.wikipedia.org" { UIApplication.shared.open(url, options: [:], completionhandler: nil) decisionhandler(.cancel) return
35 func webview(_: WKWebView, decidepolicyfor: WKNavigationAction, (WKNavigationActionPolicy) -> Void) { // If we are loading for any reason other than a link activated // then just process it. guard decidepolicyfor.navigationtype ==.linkactivated else { decisionhandler(.allow) return // Reroute any request for wikipedia out to the default browser // then cancel the request. let request = decidepolicyfor.request if let url = request.url, let host = url.host, host == "en.m.wikipedia.org" { UIApplication.shared.open(url, options: [:], completionhandler: nil) decisionhandler(.cancel) return // By default allow the other requests to continue decisionhandler(.allow)
36
37 func webview(_ webview: WKWebView, decidepolicyfor navigationresponse: WKNavigationResponse, (WKNavigationResponsePolicy) -> Void)
38
39 WKNavigationReponse canshowmimetype isformainframe reponse
40 Handling Javascript UI <script> function showdetails() { alert(" The entire work of this article is based on the Census of India, 2011, conducted by the Office of the Registrar General and Census Commissioner, under Ministry of Home Affairs (India), Government of India.") </script> <p style="intro"> <button onclick="showdetails()">details</button> </p>
41
42
43 WKUIDelegate webview.uidelegate = self
44 WKUIDelegate // // ViewController+WKUIDelegate.swift // WKWebKitExample // // Created by Scotty on 01/10/2017. // Copyright 2017 Diligent Robot. All rights reserved. // import UIKit import WebKit extension ViewController: WKUIDelegate {
45 func webview(_ webview: WKWebView, runjavascriptalertpanelwithmessage message: String, initiatedbyframe frame: WKFrameInfo, () -> Void) { let alert = UIAlertController(title: "Message", message: message, preferredstyle: UIAlertControllerStyle.alert) alert.addaction(uialertaction(title: "OK", style: UIAlertActionStyle.default, handler: nil)) self.present(alert, animated: true, completion: nil) completionhandler()
46
47 Configuration
48
49 Configuration let config = WKWebViewConfiguration() webview = WKWebView(frame: self.webviewcontainter.frame, configuration: config) webview.navigationdelegate = self webview.uidelegate = self webview.translatesautoresizingmaskintoconstraints = false webviewcontainter.addsubview(webview) webviewcontainter.addconstraints(nslayoutconstraint.constraints(withvisualformat: " [webview] ", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["webview": webview])) webviewcontainter.addconstraints(nslayoutconstraint.constraints(withvisualformat: "V: [webview] ", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["webview": webview]))
50 Multiple WKWebView instances can share a single WKWebViewConfiguration instance.
51 Customizing Webpage Content User Scripts Script Messages
52
53 WKUserContentController property usercontentcontroller on WKWebViewConfiguration
54 User Scripts User scripts are JavaScript (files) that get injected into the page loaded in a WKWebView When: They can run either at "Document Start" or "Document End" Where: All Frames or Main Frame Only
55
56
57 // Change colors. var style = document.createelement('style'); style.type = 'text/css'; style.innerhtml = '.town a { color: #FF9933;.state a { color: # population { color: # '; document.getelementsbytagname('head')[0].appendchild(style);
58 // Change colors. var style = document.createelement('style'); style.type = 'text/css';
59 style.innerhtml = '.town a { color: #FF9933;.state a { color: # population { color: # ';
60 .town a { color: #FF9933;.state a { color: #000080;.population { color: #138808;
61 document.getelementsbytagname('head')[0].appendchild(style);
62 private func loadscripts(config: WKWebViewConfiguration) { guard let filepath = Bundle.main.path(forResource: "change-css", oftype: "js") else { return do { let javascript = try String(contentsOfFile: filepath) let userscript = WKUserScript(source: javascript, injectiontime:.atdocumentend, formainframeonly: true) config.usercontentcontroller.adduserscript(userscript) catch { fatalerror("something went wrong: \(error)")
63 let javascript = try String(contentsOfFile: filepath) let userscript = WKUserScript(source: javascript, injectiontime:.atdocumentend, formainframeonly: true) config.usercontentcontroller.adduserscript(userscript)
64
65
66 // Called by App to get the WKWebView to filter towns function filter(searchtext) { var table = document.getelementbyid("towntable") filtertowns(table, searchtext); // Called by App to clear all town filtering function clearfilter() { unfiltertowns(); var lastcontainer; // Find all town entries. // If they do not match the current filter add the //.notfound class to the element function filtertowns(container,what) { unfiltertowns(); var townrows = container.getelementsbyclassname('townrow'); var searchexp = new RegExp('^' + what,'i'); for (var i = 0; i < townrows.length; ++i) { var towns = townrows[i].getelementsbyclassname('town') if (towns.length > 0) { var town = towns[0] var links = town.getelementsbytagname('a'); if (links.length > 0 ) { var text = links[0].innerhtml; if (!text.match(searchexp)) { townrows[i].classlist.add('notfound') lastcontainer = container // Remove all.notfound css entries. function unfiltertowns() { if (lastcontainer == null) { return; var hiddentowns = lastcontainer.getelementsbyclassname('notfound'); for (var i = 0; i < hiddentowns.length; ++i) { hiddentowns[i].classlist.remove('notfound'); // Add the.notfound CSS Style. var style = document.createelement('style'); style.type = 'text/css'; style.innerhtml = '.notfound { display: none; '; document.getelementsbytagname('head')[0].appendchild(style);
67 // Add the.notfound CSS Style. var style = document.createelement('style'); style.type = 'text/css'; style.innerhtml = '.notfound { display: none; '; document.getelementsbytagname('head')[0].appendchild(style);
68 <tr class="townrow" > <td class="town"> <a href=" title="achhnera"> Achhnera </a> </td> <td class="state"> <a href=" title="uttar Pradesh"> Uttar Pradesh </a> </td> <td class="population"> 22,781 </td> </tr>
69 function filtertowns(container,what) { unfiltertowns(); var townrows = container.getelementsbyclassname('townrow'); var searchexp = new RegExp('^' + what,'i'); for (var i = 0; i < townrows.length; ++i) { var towns = townrows[i].getelementsbyclassname('town') if (towns.length > 0) { var town = towns[0] var links = town.getelementsbytagname('a'); if (links.length > 0 ) { var text = links[0].innerhtml; if (!text.match(searchexp)) { townrows[i].classlist.add('notfound') lastcontainer = container
70 // Remove all.notfound css entries. function unfiltertowns() { if (lastcontainer == null) { return; var hiddentowns = lastcontainer.getelementsbyclassname('notfound'); for (var i = 0; i < hiddentowns.length; ++i) { hiddentowns[i].classlist.remove('notfound');
71 // Called by App to get the WKWebView to filter towns function filter(searchtext) { var table = document.getelementbyid("towntable") filtertowns(table, searchtext); // Called by App to clear all town filtering function clearfilter() { unfiltertowns();
72 private func loadscripts(config: WKWebViewConfiguration) { guard let changecssfilepath = Bundle.main.path(forResource: "changecss", oftype: "js"), let filtertownsfilepath = Bundle.main.path(forResource: "filtertowns", oftype: "js")else { fatalerror("scripts Not Found") do { let changecssjs = try String(contentsOfFile: changecssfilepath) let changecssuserscript = WKUserScript(source: changecssjs, injectiontime:.atdocumentend, formainframeonly: true) config.usercontentcontroller.adduserscript(changecssuserscript) let filtertownsjs = try String(contentsOfFile: filtertownsfilepath) let filtertownsuserscript = WKUserScript(source: filtertownsjs, injectiontime:.atdocumentend, formainframeonly: true) config.usercontentcontroller.adduserscript(filtertownsuserscript) catch { fatalerror("something went wrong: \(error)")
73 extension ViewController: UISearchBarDelegate { func searchbar(_ searchbar: UISearchBar, textdidchange searchtext: String) { filtertowns(filter: searchtext) func filtertowns(filter: String) { let js = "filter(\"\(filter)\");" webview.evaluatejavascript(js) { (_, error) in if let error = error { self.processjserror(error) return
74 private func processjserror(_ error: Error) { DispatchQueue.main.async { let alert = UIAlertController(title: "Error", message: error.localizeddescription, preferredstyle:.alert) alert.addaction(uialertaction(title: "OK", style:.default, handler: nil)) self.present(alert, animated: true, completion: nil)
75
76
77 // Called by App to get the WKWebView to filter towns function filter(searchtext) { var table = document.getelementbyid("towntable") return filtertowns(table, searchtext);
78 function filtertowns(container,what) { unfiltertowns(); var count = 0; var townrows = container.getelementsbyclassname('townrow'); var searchexp = new RegExp('^' + what,'i'); for (var i = 0; i < townrows.length; ++i) { var towns = townrows[i].getelementsbyclassname('town') if (towns.length > 0) { var town = towns[0] var links = town.getelementsbytagname('a'); if (links.length > 0 ) { var text = links[0].innerhtml; if (!text.match(searchexp)) { townrows[i].classlist.add('notfound') else { count ++ lastcontainer = container return count;
79 func filtertowns(filter: String) { let js = "filter(\"\(filter)\");" webview.evaluatejavascript(js) { (count, error) in if let error = error { self.processjserror(error) return DispatchQueue.main.async { if let count = count as? Int { self.countlabel.text = "\(count) town(s)" else { self.countlabel.text = ""
80
81 var initialloadaction: WKNavigation? initialloadaction = webview.load(urlrequest(url:url)) func webview(_: WKWebView, didfinish: WKNavigation!) { guard didfinish == initialloadaction else { return self.filtertowns(filter: searchfield.text?? "")
82 Having the page let us know something is happening.
83 Script Messages
84
85 Register to receive a message config.usercontentcontroller.add(self, name: "populationhaschanged")
86
87 import UIKit import WebKit extension ViewController: WKScriptMessageHandler { func usercontentcontroller(_ usercontentcontroller: WKUserContentController, didreceive message: WKScriptMessage) {
88
89
90 function filtertowns(container,what) { unfiltertowns(); var count = 0; var populationcount = 0; var townrows = container.getelementsbyclassname('townrow'); var searchexp = new RegExp('^' + what,'i'); for (var i = 0; i < townrows.length; ++i) { var towns = townrows[i].getelementsbyclassname('town') if (towns.length > 0) { var town = towns[0] var links = town.getelementsbytagname('a'); if (links.length > 0 ) { var text = links[0].innerhtml; if (!text.match(searchexp)) { townrows[i].classlist.add('notfound') else { var populations = townrows[i].getelementsbyclassname('population'); if (populations.length > 0) { var population = populations[0]; var populationtext = population.innerhtml.replace(',',''); var populationint = parseint(populationtext); if (isnan(populationint) == false) { populationcount += populationint; count ++ lastcontainer = container if (populationcount!= lastpopulationcount) { var message = { "population": populationcount webkit.messagehandlers.populationhaschanged.postmessage(message) lastpopulationcount = populationcount; return count;
91 var populationcount = 0;
92 var populations = townrows[i].getelementsbyclassname('population'); if (populations.length > 0) { var population = populations[0]; var populationtext = population.innerhtml.replace(',',''); var populationint = parseint(populationtext); if (isnan(populationint) == false) { populationcount += populationint;
93 if (populationcount!= lastpopulationcount) { var message = { "population": populationcount webkit.messagehandlers.populationhaschanged.postmessage(message) lastpopulationcount = populationcount;
94 import UIKit import WebKit extension ViewController: WKScriptMessageHandler { func usercontentcontroller(_ usercontentcontroller: WKUserContentController, didreceive message: WKScriptMessage) { guard message.name == "populationhaschanged", let body = message.body as? [String: Any], let population = body["population"] as? Int else { return DispatchQueue.main.async { self.populationlabel.text = "Population: \(population)"
95
96 <img src="dr-bundle-file://india-map.png" width="100%"/>
97
98 let config = WKWebViewConfiguration() loadscripts(config: config) setupschemes(config: config) private func setupschemes(config: WKWebViewConfiguration) { config.seturlschemehandler(self, forurlscheme: "dr-bundle-file")
99 import UIKit import WebKit extension ViewController: WKURLSchemeHandler { func webview(_ webview: WKWebView, start urlschemetask: WKURLSchemeTask) { func webview(_ webview: WKWebView, stop urlschemetask: WKURLSchemeTask) {
100
101
102
103 enum CustomSchemeHandlerError: Error { case noideawhattodowiththis case filenotfound(filename: String) extension ViewController: WKURLSchemeHandler { func webview(_ webview: WKWebView, start urlschemetask: WKURLSchemeTask) { guard let url = urlschemetask.request.url, let scheme = url.scheme, scheme == "dr-bundle-file" else { urlschemetask.didfailwitherror(customschemehandlererror.noideawhattodowiththis) return let urlstring = url.absolutestring let index = urlstring.index(urlstring.startindex, offsetby: 16) let file = String(urlString[index..<urlString.endIndex]) let path = (file as NSString).deletingPathExtension let ext = (file as NSString).pathExtension guard let filebundleurl = Bundle.main.url(forResource: path, withextension: ext) else { let error = CustomSchemeHandlerError.fileNotFound(fileName: "\(file)") urlschemetask.didfailwitherror(error) return do { let data = try Data(contentsOf: filebundleurl) let response = URLResponse(url: url, mimetype: ext == "png"? "image/png" : "text/html", expectedcontentlength: data.count, textencodingname: nil) urlschemetask.didreceive(response) urlschemetask.didreceive(data) urlschemetask.didfinish() catch { urlschemetask.didfailwitherror(error) func webview(_ webview: WKWebView, stop urlschemetask: WKURLSchemeTask) {
104 enum CustomSchemeHandlerError: Error { case noideawhattodowiththis case filenotfound(filename: String)
105 guard let url = urlschemetask.request.url, let scheme = url.scheme, scheme == "dr-bundle-file" else { let error = CustomSchemeHandlerError.noIdeaWhatToDoWithThis urlschemetask.didfailwitherror(error) return
106 let urlstring = url.absolutestring let index = urlstring.index(urlstring.startindex, offsetby: 16) let file = String(urlString[index..<urlString.endIndex]) let path = (file as NSString).deletingPathExtension let ext = (file as NSString).pathExtension guard let filebundleurl = Bundle.main.url(forResource: path, withextension: ext) else { let error = CustomSchemeHandlerError.fileNotFound(fileName: "\(file)") urlschemetask.didfailwitherror(error) return
107 do { let data = try Data(contentsOf: filebundleurl) let response = URLResponse(url: url, mimetype: ext == "png"? "image/png" : "text/html", expectedcontentlength: data.count, textencodingname: nil) urlschemetask.didreceive(response) urlschemetask.didreceive(data) urlschemetask.didfinish() catch { urlschemetask.didfailwitherror(error)
108
109 // if let url = Bundle.main.url(forResource: "cities", // withextension: "html") { // initialloadaction = webview.load(urlrequest(url:url)) // let url = URL(string: "dr-bundle-file:///cities.html")! initialloadaction = webview.load(urlrequest(url:url)
110 Things we have not looked at Cookie Handling Authentication Content Filtering
111
112 Code WKWebViewExample
113
114 TM 2018 Conference and Deep Dive Sessions April 24-28, IISc Bangalore Register early and get the best bit.ly/gidslinkedin
Introducing the Modern WebKit API
Frameworks #WWDC14 Introducing the Modern WebKit API Session 206 Anders Carlsson Safari and WebKit Engineer 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written
More informationITP 342 Mobile App Dev. Web View
ITP 342 Mobile App Dev Web View Web View 2 WebKit The WebKit provides a set of core classes to display web content in windows, and by default, implements features such as following links clicked by the
More informationNotifications. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder
Notifications Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Alerts Internal notifications Local
More informationSecure JavaScript UI Rendering for ios Using Swift
Masaryk University Faculty of Informatics Secure JavaScript UI Rendering for ios Using Swift Master s Thesis Matúš Novák Brno, Fall 2016 Masaryk University Faculty of Informatics Secure JavaScript UI
More informationEnhancing your apps for the next dimension of touch
App Frameworks #WWDC16 A Peek at 3D Touch Enhancing your apps for the next dimension of touch Session 228 Tyler Fox UIKit Frameworks Engineer Peter Hajas UIKit Frameworks Engineer 2016 Apple Inc. All rights
More informationApp Extension Best Practices
App Frameworks #WWDC15 App Extension Best Practices Session 224 Sophia Teutschler UIKit Engineer Ian Baird CoreOS Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted
More informationData Delivery with Drag and Drop
Session App Frameworks #WWDC17 Data Delivery with Drag and Drop 227 Dave Rahardja, UIKit Tanu Singhal, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without
More informationBuilding the App - Part 5 - Adding a Link
Unit 4 - Coding For Your App Copy and Paste the code below exactly where the tutorials tell you. DO NOT COPY TEXT IN RED. Building the App - Part 5 - Adding a Link XCODE 7 @IBAction func Button1(_ sender:
More information# T C 1 8. Mobile App Bootstrap. Custom mobile apps with embedded Tableau visualizations. Ron Theis. Staff Software Engineer Tableau
Welcome # T C 1 8 Mobile App Bootstrap Custom mobile apps with embedded Tableau visualizations Ron Theis Staff Software Engineer Tableau Questions to Consider How would our app connect and authenticate?
More informationEngineering for Testability
Session Developer Tools #WWDC17 Engineering for Testability 414 Brian Croom, Xcode Engineer Greg Tracy, Xcode Engineer 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted
More informationStatic Webpage Development
Dear Student, Based upon your enquiry we are pleased to send you the course curriculum for PHP Given below is the brief description for the course you are looking for: - Static Webpage Development Introduction
More informationWhere s My Browser? Learn Hacking ios and Android WebViews
Where s My Browser? Learn Hacking ios and Android WebViews David Turco (@endle ) Jon Overgaard Christiansen Workshop DEF CON 26 2 Who Are We? David Turco (@endle ) Senior Security Consultant Context Information
More informationMastering Drag and Drop
Session App Frameworks #WWDC17 Mastering Drag and Drop 213 Tom Adriaenssen, UIKit Wenson Hsieh, WebKit Robb Böhnke, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted
More informationWeb development using PHP & MySQL with HTML5, CSS, JavaScript
Web development using PHP & MySQL with HTML5, CSS, JavaScript Static Webpage Development Introduction to web Browser Website Webpage Content of webpage Static vs dynamic webpage Technologies to create
More informationControlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.
Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible
More informationDesign Document V2 ThingLink Startup
Design Document V2 ThingLink Startup Yon Corp Andy Chen Ashton Yon Eric Ouyang Giovanni Tenorio Table of Contents 1. Technology Background.. 2 2. Design Goal...3 3. Architectural Choices and Corresponding
More informationlast time: command injection
Web Security 1 last time: command injection 2 placing user input in more complicated language SQL shell commands input accidentally treated as commands in language instead of single value (e.g. argument/string
More informationStream iphone Sensor Data to Adafruit IO
Stream iphone Sensor Data to Adafruit IO Created by Trevor Beaton Last updated on 2019-01-22 04:07:41 PM UTC Guide Contents Guide Contents Overview In this learn guide we will: Before we start... Downloading
More informationIntroduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p.
Preface p. xiii Introduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p. 5 Client-Side JavaScript: Executable Content
More informationRevision for Grade 7 ASP in Unit :1&2 Design & Technology Subject
Your Name:.... Grade 7 - SECTION 1 Matching :Match the terms with its explanations. Write the matching letter in the correct box. The first one has been done for you. (1 mark each) Term Explanation 1.
More informationProgramming Lab 1 (JS Hwk 3) Due Thursday, April 28
Programming Lab 1 (JS Hwk 3) Due Thursday, April 28 Lab You may work with partners for these problems. Make sure you put BOTH names on the problems. Create a folder named JSLab3, and place all of the web
More informationWhat s New in tvos #WWDC16. App Frameworks. Session 206. Hans Kim tvos Engineer
App Frameworks #WWDC16 What s New in tvos Session 206 Hans Kim tvos Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Welcome
More informationlecture 6 Closures, Networking, CocoaPods
lecture 6 Closures, Networking, CocoaPods cs198-001 : spring 2018 announcements no new lab this week - continuation of Pokedex lab + custom app workday (attendance still required) Pokedex due Wednesday
More informationCreating SDK plugins
Creating SDK plugins 1. Introduction... 3 2. Architecture... 4 3. SDK plugins... 5 4. Creating plugins from a template in Visual Studio... 6 5. Creating custom action... 9 6. Example of custom action...10
More informationCreating Extensions for Safari
Creating Extensions for Safari Part One Timothy Hatcher Safari and WebKit Engineer 2 3 HTML5 CSS3 JavaScript Native Code 4 Cross Platform Secure Crashes 5 What You ll Learn When to make a Safari Extension
More informationClient Side JavaScript and AJAX
Client Side JavaScript and AJAX Client side javascript is JavaScript that runs in the browsers of people using your site. So far all the JavaScript code we've written runs on our node.js server. This is
More informationJS Lab 1: (Due Thurs, April 27)
JS Lab 1: (Due Thurs, April 27) For this lab, you may work with a partner, or you may work alone. If you choose a partner, this will be your partner for the final project. If you choose to do it with a
More informationLinkify Documentation
Linkify Documentation Release 1.0.0 Studio Ousia November 01, 2014 Contents 1 Developer Support 3 1.1 Customize Linkify Application..................................... 3 1.2 Embed to ios App............................................
More informationPlatform. Custom Embedded Tabs. Custom Embedded Tab Definitions. Custom Embedded Tabs, page 1
Custom Embedded Tabs, page 1 Custom Embedded Tabs Applies to Cisco Jabber for desktop and mobile clients. Custom embedded tabs display HTML content in the client interface. Learn how to create custom embedded
More informationFull Stack Web Developer
Full Stack Web Developer S.NO Technologies 1 HTML5 &CSS3 2 JavaScript, Object Oriented JavaScript& jquery 3 PHP&MYSQL Objective: Understand the importance of the web as a medium of communication. Understand
More informationWeb Programming Step by Step
Web Programming Step by Step Lecture 15 Unobtrusive JavaScript Reading: 8.1-8.3 Except where otherwise noted, the contents of this presentation are Copyright 2009 Marty Stepp and Jessica Miller. 8.1: Global
More informationLECTURE-3. Exceptions JS Events. CS3101: Programming Languages: Javascript Ramana Isukapalli
LECTURE-3 Exceptions JS Events 1 EXCEPTIONS Syntax and usage Similar to Java/C++ exception handling try { // your code here catch (excptn) { // handle error // optional throw 2 EXCEPTIONS EXAMPLE
More informationWhat s New in imessage Apps
Session App Frameworks #WWDC17 What s New in imessage Apps 234 Eugene Bistolas, Messages Engineer Jay Chae, Messages Engineer Stephen Lottermoser, Messages Engineer 2017 Apple Inc. All rights reserved.
More informationCreating Content with iad JS
Creating Content with iad JS Part 2 The iad JS Framework Antoine Quint iad JS Software Engineer ios Apps and Frameworks 2 Agenda Motivations and Features of iad JS Core JavaScript Enhancements Working
More informationBuilding mobile app using Cordova and AngularJS, common practices. Goran Kopevski
Building mobile app using Cordova and AngularJS, common practices Goran Kopevski Agenda What is cordova? How to choose proper JS framework Building mobile app using Cordova and AngularJS Common fails,
More informationCustom Embedded Tabs, on page 1 Configure Cisco Jabber for Android on Chromebook, on page 8 Cisco Jabber Mobile App Promotion, on page 9
Custom Embedded Tabs, on page 1 Configure Cisco Jabber for Android on Chromebook, on page 8 Cisco Jabber Mobile App Promotion, on page 9 Custom Embedded Tabs Applies to Cisco Jabber for desktop and mobile
More informationJavaScript. jquery and other frameworks. Jacobo Aragunde Pérez. blogs.igalia.com/jaragunde
JavaScript static void _f_do_barnacle_install_properties(gobjectclass *gobject_class) { GParamSpec *pspec; /* Party code attribute */ pspec = g_param_spec_uint64 (F_DO_BARNACLE_CODE, jquery and other frameworks
More informationSCRIPT REFERENCE. UBot Studio Version 4. The UI Commands
SCRIPT REFERENCE UBot Studio Version 4 The UI Commands UI Text Box This command creates a field in the UI area at the top of the browser. Drag the command from the toolbox into the scripting area. In the
More informationMarketo Forms Integration Guide
The SendSafely Secure Upload Widget can be easily integrated into any Marketo Form. Once integrated, users can secure attach files to any Marketo form. If you are not familiar with how SendSafely works,
More informationUse the API or contact customer service to provide us with the following: General ios Android App Name (friendly one-word name)
Oplytic Attribution V 1.2.0 December 2017 Oplytic provides attribution for app-to-app and mobile-web-to-app mobile marketing. Oplytic leverages the tracking provided by Universal Links (ios) and App Links
More informationNode.js. Node.js Overview. CS144: Web Applications
Node.js Node.js Overview JavaScript runtime environment based on Chrome V8 JavaScript engine Allows JavaScript to run on any computer JavaScript everywhere! On browsers and servers! Intended to run directly
More informationJScript Reference. Contents
JScript Reference Contents Exploring the JScript Language JScript Example Altium Designer and Borland Delphi Run Time Libraries Server Processes JScript Source Files PRJSCR, JS and DFM files About JScript
More information} override func didreceivememorywarning() { 26 super.didreceivememorywarning() 27 } 28 } Pause Stop
Chapter 30 30.1 App App MP3 Don t Download This Song [1] Finder MP3 Xcode UI 1 import UIKit 2 import AVFoundation 3 4 class ViewController: UIViewController { 5 6 var player: AVAudioPlayer? 7 8 override
More informationJavaScript Introduction
JavaScript Introduction Web Technologies I. Zsolt Tóth University of Miskolc 2016 Zsolt Tóth (UM) JavaScript Introduction 2016 1 / 31 Introduction Table of Contents 1 Introduction 2 Syntax Variables Control
More informationBuilding for Voice with Siri Shortcuts
#WWDC18 Building for Voice with Siri Shortcuts Session 214 Amit Jain, Siri Ayaka Nonaka, Siri 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission
More informationWeb Security. Jace Baker, Nick Ramos, Hugo Espiritu, Andrew Le
Web Security Jace Baker, Nick Ramos, Hugo Espiritu, Andrew Le Topics Web Architecture Parameter Tampering Local File Inclusion SQL Injection XSS Web Architecture Web Request Structure Web Request Structure
More informationWeb UI. Survey of Front End Technologies. Web Challenges and Constraints. Desktop and mobile devices. Highly variable runtime environment
Web UI Survey of Front End Technologies Web UI 1 Web Challenges and Constraints Desktop and mobile devices - mouse vs. touch input, big vs. small screen Highly variable runtime environment - different
More informationBuild Native-like Experiences in HTML5
Developers Build Native-like Experiences in HTML5 The Chrome Apps Platform Joe Marini - Chrome Developer Advocate About Me Joe Marini Developer Relations Lead - Google Chrome google.com/+joemarini @joemarini
More informationCOMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)
COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,
More informationJavascript Performance in the Browser. Charlie Fiskeaux II User Interface Engineer
Javascript Performance in the Browser Charlie Fiskeaux II User Interface Engineer About Me & Circonus Lead User Interface Engineer for Circonus Industry-leading monitoring and analytics platform We deploy
More informationA340 Laboratory Session #5
A340 Laboratory Session #5 LAB GOALS Creating multiplication table using JavaScript Creating Random numbers using the Math object Using your text editor (Notepad++ / TextWrangler) create a web page similar
More informationPIC 40A. Lecture 4b: New elements in HTML5. Copyright 2011 Jukka Virtanen UCLA 1 04/09/14
PIC 40A Lecture 4b: New elements in HTML5 04/09/14 Copyright 2011 Jukka Virtanen UCLA 1 Sectioning elements HTML 5 introduces a lot of sectioning elements. Meant to give more meaning to your pages. People
More informationWeb basics: HTTP cookies
Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh February 11, 2016 1 / 27 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the
More informationSCRIPT REFERENCE. UBot Studio Version 4. The Settings Commands
SCRIPT REFERENCE UBot Studio Version 4 The Settings Commands This entire section of commands is related specifically to settings that are available for the main browser as well as the in new browser command.
More informationCOMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)
COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,
More informationPIC 40A. Midterm 1 Review
PIC 40A Midterm 1 Review XHTML and HTML5 Know the structure of an XHTML/HTML5 document (head, body) and what goes in each section. Understand meta tags and be able to give an example of a meta tags. Know
More informationCIS 3308 Logon Homework
CIS 3308 Logon Homework Lab Overview In this lab, you shall enhance your web application so that it provides logon and logoff functionality and a profile page that is only available to logged-on users.
More informationSichere Webanwendungen mit Java
Sichere Webanwendungen mit Java Karlsruher IT- Sicherheitsinitiative 16.07.2015 Dominik Schadow bridgingit Patch fast Unsafe platform unsafe web application Now lets have a look at the developers OWASP
More informationProgramming with the Finesse API
Programming with the Finesse API OpenSocial Gadgets Source: http://www.slideshare.net/wuzziwug/opensocial-intro-presentation OpenSocial Gadgets A gadget spec: Is an XML file Defines metadata about an OpenSocial
More informationHow is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach
Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh March 30, 2015 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the server sends
More informationWeb Site Development with HTML/JavaScrip
Hands-On Web Site Development with HTML/JavaScrip Course Description This Hands-On Web programming course provides a thorough introduction to implementing a full-featured Web site on the Internet or corporate
More informationCST272 Getting Started Page 1
CST272 Getting Started Page 1 1 2 3 4 5 6 8 Introduction to ASP.NET, Visual Studio and C# CST272 ASP.NET Static and Dynamic Web Applications Static Web pages Created with HTML controls renders exactly
More informationRKN 2015 Application Layer Short Summary
RKN 2015 Application Layer Short Summary HTTP standard version now: 1.1 (former 1.0 HTTP /2.0 in draft form, already used HTTP Requests Headers and body counterpart: answer Safe methods (requests): GET,
More informationUser Interaction: jquery
User Interaction: jquery Assoc. Professor Donald J. Patterson INF 133 Fall 2012 1 jquery A JavaScript Library Cross-browser Free (beer & speech) It supports manipulating HTML elements (DOM) animations
More informationITP 342 Mobile App Dev. Animation
ITP 342 Mobile App Dev Animation Views Views are the fundamental building blocks of your app's user interface, and the UIView class defines the behaviors that are common to all views. Responsibilities
More informationManaging Documents In Your ios Apps
Session #WWDC18 Managing Documents In Your ios Apps 216 Brandon Tennant, Software Engineer Thomas Deniau, Software Engineer Rony Fadel, Software Engineer 2018 Apple Inc. All rights reserved. Redistribution
More informationImplementing Oath s CMP JS
Implementing Oath s CMP JS A Guide For Third Party Publishers - V1.1 Table of contents Implementing Oath s CMP JS A Guide For Third Party Publishers - V1.1........ 1 What s new in this version?...............................
More informationsrc1-malan/ajax/ajax1.html ajax1.html Gets stock quote from quote1.php via Ajax, displaying result with alert().
src1-malan/ajax/ajaxhtml 1 1 1 1 1 2 2 2 2 2 2 2 2 30. 3 3 3 3 3 3 3 3 3 40. 4 4 4 4 4 4 4 4 ajaxhtml Gets stock quote from quotephp via Ajax, displaying result with alert(). Building Mobile Applications
More informationConfiguring Anonymous Access to Analysis Files in TIBCO Spotfire 7.5
Configuring Anonymous Access to Analysis Files in TIBCO Spotfire 7.5 Introduction Use Cases for Anonymous Authentication Anonymous Authentication in TIBCO Spotfire 7.5 Enabling Anonymous Authentication
More informationNetAdvantage for jquery SR Release Notes
NetAdvantage for jquery 2012.1 SR Release Notes Create the best Web experiences in browsers and devices with our user interface controls designed expressly for jquery, ASP.NET MVC, HTML 5 and CSS 3. You
More informationMASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M
MASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M COURSE OBJECTIVES Enable participants to develop a complete web application from the scratch that includes
More informationAdvanced Notifications
System Frameworks #WWDC16 Advanced Notifications Session 708 Michele Campeotto ios Notifications 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission
More informationClient vs Server Scripting
Client vs Server Scripting PHP is a server side scripting method. Why might server side scripting not be a good idea? What is a solution? We could try having the user download scripts that run on their
More informationWriting Web Apps in C++? Eric Bidelman, Google COSCUP / GNOME.Asia - Taipei, Taiwan August 14, 2010
Writing Web Apps in C++? Eric Bidelman, Google COSCUP / GNOME.Asia - Taipei, Taiwan August 14, 2010 Agenda Overview of Native Client SDK Calculator tutorial Demos Native Client Native Client ( NaCl ) The
More informationimessage Apps and Stickers, Part 2
App Frameworks #WWDC16 imessage Apps and Stickers, Part 2 Interactive Messages Session 224 Alex Carter Messages Engineer Stephen Lottermoser Messages Engineer 2016 Apple Inc. All rights reserved. Redistribution
More informationStamp Builder. Documentation. v1.0.0
Stamp Email Builder Documentation http://getemailbuilder.com v1.0.0 THANK YOU FOR PURCHASING OUR EMAIL EDITOR! This documentation covers all main features of the STAMP Self-hosted email editor. If you
More informationSettings. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder
Settings Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline In-app settings UserDefaults Device settings
More informationJavaScript: Objects, BOM, and DOM CS 4640 Programming Languages for Web Applications
JavaScript: Objects, BOM, and DOM CS 4640 Programming Languages for Web Applications 1 Objects How group do variables Web and Apps functions fit to create in with a model the World Around Them? representing
More informationHTTP Security Headers Explained
HTTP Security Headers Explained Scott Sauber Slides at scottsauber.com scottsauber Audience Anyone with a website Agenda What are HTTP Security Headers? Why do they matter? HSTS, XFO, XSS, CSP, CTO, RH,
More informationUI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML
UI Course (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) HTML: Introduction The World Wide Web (WWW) and history of HTML Hypertext and Hypertext Markup Language Why HTML Prerequisites Objective
More informationOn the Change in Archivability of Websites Over Time
Old Dominion University ODU Digital Commons Computer Science Presentations Computer Science 9-23-2013 On the Change in Archivability of Websites Over Time Mat Kelly Old Dominion University Justin F. Brunelle
More informationAjax HTML5 Cookies. Sessions 1A and 1B
Ajax HTML5 Cookies Sessions 1A and 1B JavaScript Popular scripting language: Dynamic and loosely typed variables. Functions are now first-class citizens. Supports OOP. var simple = 2; simple = "I'm text
More informationSecure RESTful Web Services to Mobilize Powerful Website Penetration Testing Tools
Secure RESTful Web Services to Mobilize Powerful Website Penetration Testing Tools Problem statement Powerful penetration testing cyber security tools and techniques are freely available via OS based distributions.
More information<script> function yourfirstfunc() { alert("hello World!") } </script>
JavaScript: Lesson 1 Terms: HTML: a mark-up language used for web pages (no power) CSS: a system for adding style to web pages css allows developers to choose how to style the html elements in a web page
More informationJavaScript and Objects CS 4640 Programming Languages for Web Applications
JavaScript and Objects CS 4640 Programming Languages for Web Applications 1 Objects How group do variables Web and Apps functions fit to create in with a model the World Around Them? representing something
More informationCopyright 2014, Oracle and/or its affiliates. All rights reserved.
1 Introduction to the Oracle Mobile Development Platform Dana Singleterry Product Management Oracle Development Tools Global Installed Base: PCs vs Mobile Devices 3 Mobile Enterprise Challenges In Pursuit
More informationWhat's New in Core Spotlight
Session System Frameworks #WWDC17 What's New in Core Spotlight Search on macos and ios 231 John Hörnkvist, Spotlight Lyn Fong, Spotlight 2017 Apple Inc. All rights reserved. Redistribution or public display
More informationLecture Overview. IN5290 Ethical Hacking. Lecture 4: Web hacking 1, Client side bypass, Tampering data, Brute-forcing
Lecture Overview IN5290 Ethical Hacking Lecture 4: Web hacking 1, Client side bypass, Tampering data, Brute-forcing Summary - how web sites work HTTP protocol Client side server side actions Accessing
More informationThingLink User Guide. Andy Chen Eric Ouyang Giovanni Tenorio Ashton Yon
ThingLink User Guide Yon Corp Andy Chen Eric Ouyang Giovanni Tenorio Ashton Yon Index Preface.. 2 Overview... 3 Installation. 4 Functionality. 5 Troubleshooting... 6 FAQ... 7 Contact Information. 8 Appendix...
More informationIntroducing PDFKit on ios
Session App Frameworks #WWDC17 Introducing PDFKit on ios PDF on macos and ios 241 Jeremy Bridon, Software Engineer Nicki Brower, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or
More informationIT6503 WEB PROGRAMMING. Unit-I
Department of Information Technology Question Bank- Odd Semester 2015-2016 IT6503 WEB PROGRAMMING Unit-I SCRIPTING 1. What is HTML? Write the format of HTML program. 2. Differentiate HTML and XHTML. 3.
More informationWeb basics: HTTP cookies
Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh November 20, 2017 1 / 32 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the
More informationJavaScript. What s wrong with JavaScript?
JavaScript 1 What s wrong with JavaScript? A very powerful language, yet Often hated Browser inconsistencies Misunderstood Developers find it painful Lagging tool support Bad name for a language! Java
More informationLecture 8 Demo Code: Cassini Multithreading
Lecture 8 Demo Code: Cassini Multithreading Objective Included below is the source code for the demo in lecture. It is provided under the same Creative Commons licensing as the rest of CS193p s course
More informationThe City Bars App. with. Sencha Touch 2
The City Bars App with Sencha Touch 2 Sencha Touch A JavaScript framework for building rich mobile apps with web standards http://sencha.com/x/d5 http://sencha.com/x/ed Basically... Get a WebKit-based
More informationTesting ios Apps. Graham Lee Monday, 25 March 13
Testing ios Apps Graham Lee / @secboffin Penetration Unit Integration Whole-app A lot to cover Agenda Agenda High-level overview of testing options Agenda High-level overview of testing options Native
More informationRandom number generation, Math object and methods, HTML elements in motion, setinterval and clearinterval
Lab04 - Page 1 of 6 Lab 04 Monsters in a Race Random number generation, Math object and methods, HTML elements in motion, setinterval and clearinterval Additional task: Understanding pass-by-value Introduction
More informationFull Stack Web Developer
Full Stack Web Developer Course Contents: Introduction to Web Development HTML5 and CSS3 Introduction to HTML5 Why HTML5 Benefits Of HTML5 over HTML HTML 5 for Making Dynamic Page HTML5 for making Graphics
More informationSimple AngularJS thanks to Best Practices
Simple AngularJS thanks to Best Practices Learn AngularJS the easy way Level 100-300 What s this session about? 1. AngularJS can be easy when you understand basic concepts and best practices 2. But it
More informationHTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week
WEB DESIGNING HTML HTML - Introduction HTML - Elements HTML - Tags HTML - Text HTML - Formatting HTML - Pre HTML - Attributes HTML - Font HTML - Text Links HTML - Comments HTML - Lists HTML - Images HTML
More information