Whatsapp 網頁版 和 手機的溝通

Whatsapp 網頁版 如何可得到手機的認證?

Whatsapp 網頁提供了QR Code. 用家只需用手機的Whatsapp 掃一掃這個 QR Code 就可以用到 Whatsapp 網頁版。

Whatapp Web Page

究竟Whatsapp 網頁版如何做到呢?

使用Chrome 開啟 Development Tool 的 Network,就會看到有一個 Websocket 的Connection。當用家掃了 QR Code , Whatsapp 網頁版的 Server 就會通知 用家的網頁,啟用 Whatsapp 網頁版。

Whatsapp Page Network

The difference between Canvas and SVG in HTML5

Canvas and SVG

Canvas can be changed once it is painted in browser unless you re-painted it.

SVG is markup language and regarded as a DOM element in browser.

 

SVG Canvas
High Level (Regards as Objects in DOM) Low Level (Regards as bitmap image)
Standard XML Format by markup syntax Drawable region by Javascript API

 

WebGL

It allows GPU accelerated usage of physics and image processing and effects as part of web pages canvas.

It can be seen as enhanced technology to Canvas (HTML5).

From: https://en.wikipedia.org/wiki/WebGL

HTML5 – Storage

Introduction

In Browser Context, it provide three ways for storing data.

  • Local Storage, a simple key/value persistence system.
  • WebSQL, deprecated relational database.
  • IndexedDB, a NoSQL database

 

Local Storage

  • a simple key/value persistence system.
  • before HTML5, application data had to store in cookies.
  • more secure and larger storage limit.
  • per domain and protocol. i.e. All page from same domain can access the same data.

 

WebSQL

  • Basically, SQLite, a light relational database, embedded in browser.
  • Deprecated Specification

 

IndexedDB

  • a NoSQL database, a Javascript-based object-oriented database that object is retrieved by indexed key.

 

Reference:

[Deprecated] HTML5: WebSQL

WebSQL is in HTML5 Specification. But it is deprecated by W3C in November 2010. Basically, it is specification that introduces various APIs to manipulate client-side relational database using SQL.

However, not all browser support it. For example, IE does not support it.

Support: Chrome, Opera, Safari

 

Related SQL Database: Index Database API

 

Related Reading:

Beyond HTML5: Database APIs and the Road to IndexedDB

https://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/

HTML5

HTML5 Overview

It is specification by World Wide Web Consortium (W3C). It has introduced new markup, new APIs that can be called by Javascript, XHTML5.

New HTML5 API

  • HTML Geolocation
  • HTML Drag and Drop
  • HTML Local Storage
  • HTML Application Cache
  • HTML Web Workers
  • HTML SSE