7. JDLL – 3 Avril 2016
Liste des webApps dispo (1/2)
● Bluetooth
● Mobile Connecté API
● Dworkin Information
API
● Dworkin stars API
● TCP Socket API
● Phonolite
● Web SMS
● Ambient Light Sensor
API
● Battery status API
● Camera API
● Geolocalisation API
● Pointer Lock API
● Power Management API
● Proximity API
● Device Orientation API
API Communication API Matériels
8. JDLL – 3 Avril 2016
Liste des webApps dispo (2/2)
● Contacts API
● Device Storage API
● FileHandle API
● IndexedDB
● Settings API
● Alarm API
● Apps API
● Browser API
● Idle API
● Permissions API
● Simple Push API
● Time/clock API
● Web Activités
● WebPayment API
API de gestion des données API Autres
10. JDLL – 3 Avril 2016
Téléphone
- Multitouch
- WebTelephony
- WebSMS
- Geolocalisation
- Battery API
- WebNFC
- WebVibration
- WebContacts
- FullScreen API
- Settings API
- WebUSB
- Camera
- WebBluetooth
- WebGL
11. JDLL – 3 Avril 2016
Alimentation : Battery
● HTML 5
● Source importante pour un site web
● Avoir des informations sur le matériel des visiteurs
– Combien de batterie il vous reste
– Si vous utilisez un système mobile :
Smartphone, Tablette, Ordinateur portable
● But : économiser votre batterie
● Valider par W3C
12. JDLL – 3 Avril 2016
Battery Manager (1/2)
● Propriétés Disponible
● Obtenir les informations sur le niveau de charge
● Possibilité d'intéragir avec l'API d'état de la batterie
● 4 fonctions importantes
https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager
13. JDLL – 3 Avril 2016
Battery Manager (2/2)
● Statut de la batterie
BatteryManager.charging
● Temps restant de chargement (en secondes) → 100 %
BatteryManager.chargingTime
● Temps restant avant que la batterie soit décharger
BatteryManager.dischargingTime
● Niveau de la batterie (valeur entre 0 et 1.0)
BatteryManager.level
https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager
14. JDLL – 3 Avril 2016
Battery Manager : Résultat
15. JDLL – 3 Avril 2016
Espionnage / Surveillance / Vie Privée
● Les données des batteries peuvent être utiliser pour
vous traquer
● 2 informations (dispo toutes les 30 secondes) :
– Le niveau de charge de votre batterie en pourcentage
– Le temps restant avant que votre batterie ne soit
entièrement vide
● Alertes des chercheurs de sécurité
– Pas de validations et de confirmations
16. JDLL – 3 Avril 2016
Exemple
Votre Ordinateur
Identifier votre
machine
Identifier votre
machine
Résultat :
Savoir quels sites vous
visitez simultanément
→ Ces données pourront
ensuite être exploitée
17. JDLL – 3 Avril 2016
Résumé
● Une solution
– Un choix
Matériels / OS / Autres
18. JDLL – 3 Avril 2016
Pourquoi ?
● Code réutilisable
● Code libre (Freedom)
● Firefox OS est juste pour le web
API Spécifiques
19. JDLL – 3 Avril 2016
Api spécifique Téléphone / Tablette
● Connection blueTooth
● Mode vibration
● Accès à la géolocalisation
● Contacts
20. JDLL – 3 Avril 2016
API Spécifique : Périphériques
● Fonctionnalité JS
Element.addEventListener
● But : manière d'enregistrer un écouteur telle que
spécifiée dans le DOM du W3C
● Ecoute :
– Souris : mouse…
– Batterie : chargingchange
– Orientation : deviceorientation
– ...
22. JDLL – 3 Avril 2016
Connecteurs : Exemple « jeu » 1/2
● Captain Rogers
● Jouabilité
23. JDLL – 3 Avril 2016
Connecteurs : Exemple « jeu » 2 / 2
window.addEventListener("keydow
n", function(evt) {
console.log(evt.keyCode);
}, this);
window.addEventListener("touchs
tart", function(evt) {
console.log(evt.keyCode);
}, this);
24. JDLL – 3 Avril 2016
Manette de jeu USB
function keydown(ev)
{
if (!ev) ev = event;
if (game) {
if ((ev.keyCode == 37)||(ev.keyCode == 65)) game.turnShip(0.1);
if ((ev.keyCode == 39)||(ev.keyCode == 68)) game.turnShip(-0.1);
if ((ev.keyCode == 38)||(ev.keyCode == 87)) game.boostShip(10);
if (ev.keyCode == 32) game.shipFire();
if (ev.keyCode == 13) game.startGame();
}
}
25. JDLL – 3 Avril 2016
API Spécifique : IoT Proximité
● Détection :
element.addEventListener('deviceproximity')
● Communiqué avec d'autres appareils
● Contrôle à distance
26. JDLL – 3 Avril 2016
API Proximité Exemple 1
● Son / Musique
27. JDLL – 3 Avril 2016
Exemple 1 Utilisation
● Web API audio
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
source = audioCtx.createMediaStreamSource(stream);
source.connect(analyser);
analyser.connect(distortion);
distortion.connect(biquadFilter);
biquadFilter.connect(gainNode);
gainNode.connect(audioCtx.destination);
28. JDLL – 3 Avril 2016
API Proximité Exemple 2
● Tablette / Ecran / Projection
29. JDLL – 3 Avril 2016
Exemple 2 Utilisation
● Voir slides précédents
31. JDLL – 3 Avril 2016
Technologies Web
● Technologies Web
– HTML 5 / CSS 3
● Script
– Javascript / Web API
● Graphique
– SVG / WebGL
● Autre
– MathML
32. JDLL – 3 Avril 2016
WebApps
● Disponible depuis de 1.0
● Script manifest
{
"name": "Mon application",
"description": "Une description courte de l'application",
"launch_path": "/",
"icons": {
"128": "/img/icone-128.png"
},
"developer": {
"name": "Votre nom ou celle de votre organisation",
"url": "http://votre-site-web.org"
},
"default_locale": "fr"
}
33. JDLL – 3 Avril 2016
Add-ons
● Dispo à partir de Firefox OS 2.5
{
"manifest_version": 1,
"name": "Add-on banner",
"description": "Firefox OS add-on example",
"version": "1.0",
"author": "Chris Mills",
"content_scripts": [{
"matches": ["app://system.gaiamobile.org/index.html"],
"css": ["css/style.css"],
"js": ["js/index.js"]
}],
"icons": {
"128": "/icons/128.png"
}
34. JDLL – 3 Avril 2016
Compatibilité
● Apache Cordova (PhoneGap)
– Au niveau compatibilité iOS et Android
35. JDLL – 3 Avril 2016
Hors ligne
● La gestion de CACHE est deprecated
● Service workers API
https://developer.mozilla.org/fr/docs/Web/API/Service_Worker_API
37. JDLL – 3 Avril 2016
Protection
● Navigation Privée
● Do Not Track
38. JDLL – 3 Avril 2016
Permissions
● Autorisation
● Les Applications qui demandent des accès ???
– Contacts
– Géolocalisations
– Etc..
39. JDLL – 3 Avril 2016
Sécurité : OWASP Top 10 IoT
https://www.owasp.org/index.php/OWASP_Internet_of_Things_Project
● 1-Insecure Web Interface
● 2-Insufficient Authentication/Authorization
● 3-Insecure Network Services
● 4-Lack of Transport Encryption
● 5-Privacy Concerns
● 6-Insecure Cloud Interface
● 7-Insecure Mobile Interface
● 8-Insufficient Security Configurability
● 9-Insecure Software/Firmware
● 10-Poor Physical Security
40. JDLL – 3 Avril 2016
Ressources
● Guides pour développeur web
– https://developer.mozilla.org/fr/docs/Web/Guide
● Tutoriels pour développeurs Web
– https://developer.mozilla.org/fr/docs/Web/Tutoriels
● Hacks Mozilla
– http://hacks.mozilla.org
● Webapp API
– https://developer.mozilla.org/fr/docs/WebAPI
41. JDLL – 3 Avril 2016
Comparateur HTML 5 / Mobile
42.
43. JDLL – 3 Avril 2016
Internet des Objets (iOT)
● CyanogenMod
– Fork de AOSP et CAF (Code Aurora)
● Licence Free
● Modifie le device et le Kernel pour Firefox OS
● Disponible
https://github.com/cm-b2g/B2G.git
44. JDLL – 3 Avril 2016
Portage 1/2
● pour Android ● Pour Mac
● Modèle● Portage OS Mobile
https://github.com/mozilla-b2g
45. JDLL – 3 Avril 2016
Portage 2/2
● Arduino
● Raspberry PI et PI2● Chirimen
prochainement
46. JDLL – 3 Avril 2016
Autre
● TV Panasonic ● OS :
Ronin Web Desktop