Enviar búsqueda
Cargar
006 實作小玩具功能:chrome desktop notification
•
0 recomendaciones
•
790 vistas
Bruce Li
Seguir
簡單的tutorial:如何實作像Gmail、Google Calendar的Desktop Notification
Leer menos
Leer más
Tecnología
Empresariales
Denunciar
Compartir
Denunciar
Compartir
1 de 12
Descargar ahora
Descargar para leer sin conexión
Recomendados
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Joke Puts
Manipulating Magento - Meet Magento Belgium 2017
Manipulating Magento - Meet Magento Belgium 2017
Joke Puts
Using Components to Build Native-Quality HTML5 Apps
Using Components to Build Native-Quality HTML5 Apps
graynorton
WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.js
Robert Nyman
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
Vladimir Roudakov
Friendlier, Safer WordPress Admin Areas
Friendlier, Safer WordPress Admin Areas
Cliff Seal
Linhtinh
Linhtinh
phuhien_vhit
Security and Mobility - WordCamp Porto 2016
Security and Mobility - WordCamp Porto 2016
Marcel Schmitz
Recomendados
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Joke Puts
Manipulating Magento - Meet Magento Belgium 2017
Manipulating Magento - Meet Magento Belgium 2017
Joke Puts
Using Components to Build Native-Quality HTML5 Apps
Using Components to Build Native-Quality HTML5 Apps
graynorton
WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.js
Robert Nyman
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
Vladimir Roudakov
Friendlier, Safer WordPress Admin Areas
Friendlier, Safer WordPress Admin Areas
Cliff Seal
Linhtinh
Linhtinh
phuhien_vhit
Security and Mobility - WordCamp Porto 2016
Security and Mobility - WordCamp Porto 2016
Marcel Schmitz
Diseño de Sistemas de Diseño con Atomic Design y Pattern Lab
Diseño de Sistemas de Diseño con Atomic Design y Pattern Lab
Mauricio Angulo Sillas
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
ESUG
Angular JS blog tutorial
Angular JS blog tutorial
Claude Tech
UI5 Controls (UI5con 2016)
UI5 Controls (UI5con 2016)
Andreas Kunz
Desarrollo Sostenible Informatica
Desarrollo Sostenible Informatica
tatianaquinterolopez
DrupalCon jQuery
DrupalCon jQuery
Nathan Smith
AngularJS Compile Process
AngularJS Compile Process
Eyal Vardi
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
Binary Studio
JavaScript: Events Handling
JavaScript: Events Handling
Yuriy Bezgachnyuk
Dancing with websocket
Dancing with websocket
Damien Krotkine
Firefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next level
Frédéric Harper
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash Professional
Chris Griffith
Pinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
Wes Yanaga
Prototype UI
Prototype UI
Sébastien Gruhier
The Mouse is mightier than the sword
The Mouse is mightier than the sword
Priyanka Aash
Lecture: Vaadin Overview
Lecture: Vaadin Overview
Joonas Lehtinen
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Robert Nyman
Building a js widget
Building a js widget
Tudor Barbu
Web APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
Robert Nyman
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
Frédéric Harper
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Robert Nyman
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Frédéric Harper
Más contenido relacionado
La actualidad más candente
Diseño de Sistemas de Diseño con Atomic Design y Pattern Lab
Diseño de Sistemas de Diseño con Atomic Design y Pattern Lab
Mauricio Angulo Sillas
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
ESUG
Angular JS blog tutorial
Angular JS blog tutorial
Claude Tech
UI5 Controls (UI5con 2016)
UI5 Controls (UI5con 2016)
Andreas Kunz
Desarrollo Sostenible Informatica
Desarrollo Sostenible Informatica
tatianaquinterolopez
DrupalCon jQuery
DrupalCon jQuery
Nathan Smith
AngularJS Compile Process
AngularJS Compile Process
Eyal Vardi
La actualidad más candente
(7)
Diseño de Sistemas de Diseño con Atomic Design y Pattern Lab
Diseño de Sistemas de Diseño con Atomic Design y Pattern Lab
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
Angular JS blog tutorial
Angular JS blog tutorial
UI5 Controls (UI5con 2016)
UI5 Controls (UI5con 2016)
Desarrollo Sostenible Informatica
Desarrollo Sostenible Informatica
DrupalCon jQuery
DrupalCon jQuery
AngularJS Compile Process
AngularJS Compile Process
Similar a 006 實作小玩具功能:chrome desktop notification
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
Binary Studio
JavaScript: Events Handling
JavaScript: Events Handling
Yuriy Bezgachnyuk
Dancing with websocket
Dancing with websocket
Damien Krotkine
Firefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next level
Frédéric Harper
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash Professional
Chris Griffith
Pinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
Wes Yanaga
Prototype UI
Prototype UI
Sébastien Gruhier
The Mouse is mightier than the sword
The Mouse is mightier than the sword
Priyanka Aash
Lecture: Vaadin Overview
Lecture: Vaadin Overview
Joonas Lehtinen
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Robert Nyman
Building a js widget
Building a js widget
Tudor Barbu
Web APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
Robert Nyman
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
Frédéric Harper
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Robert Nyman
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Frédéric Harper
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Robert Nyman
Google Web Toolkit
Google Web Toolkit
Christos Stathis
Do you want a SDK with that API? (Nordic APIS April 2014)
Do you want a SDK with that API? (Nordic APIS April 2014)
Nordic APIs
Detecting headless browsers
Detecting headless browsers
Sergey Shekyan
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
Tobias Schneck
Similar a 006 實作小玩具功能:chrome desktop notification
(20)
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
Cutting edge HTML5 API you can use today (by Bohdan Rusinka)
JavaScript: Events Handling
JavaScript: Events Handling
Dancing with websocket
Dancing with websocket
Firefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next level
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash Professional
Pinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
Prototype UI
Prototype UI
The Mouse is mightier than the sword
The Mouse is mightier than the sword
Lecture: Vaadin Overview
Lecture: Vaadin Overview
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Building a js widget
Building a js widget
Web APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Google Web Toolkit
Google Web Toolkit
Do you want a SDK with that API? (Nordic APIS April 2014)
Do you want a SDK with that API? (Nordic APIS April 2014)
Detecting headless browsers
Detecting headless browsers
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
Más de Bruce Li
RSpec best practice - avoid using before and let
RSpec best practice - avoid using before and let
Bruce Li
Unlock dependency between client teams and API team with API mock and proxy
Unlock dependency between client teams and API team with API mock and proxy
Bruce Li
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Bruce Li
Refactoring Workshop (Rails Pacific 2014)
Refactoring Workshop (Rails Pacific 2014)
Bruce Li
011 優化時間分配的 app 跟心得
011 優化時間分配的 app 跟心得
Bruce Li
Rails Code Club 3 @ Taipei
Rails Code Club 3 @ Taipei
Bruce Li
Rails Code Club 2 @ Taipei
Rails Code Club 2 @ Taipei
Bruce Li
010 Better and Better 工程師就業兩年多的心得雜談
010 Better and Better 工程師就業兩年多的心得雜談
Bruce Li
009 增進效率的雜七雜八mac快速鍵與設定 part 2
009 增進效率的雜七雜八mac快速鍵與設定 part 2
Bruce Li
008 vim超基礎入門
008 vim超基礎入門
Bruce Li
007 Facebook Open Graph 相關開發簡單介紹 公開版
007 Facebook Open Graph 相關開發簡單介紹 公開版
Bruce Li
004 動機 單純的力量 讀書心得
004 動機 單純的力量 讀書心得
Bruce Li
003 Ruby小觀念與小技巧Part2
003 Ruby小觀念與小技巧Part2
Bruce Li
002 增進效率的有的沒的快速鍵與設定
002 增進效率的有的沒的快速鍵與設定
Bruce Li
001 Ruby小觀念與小技巧
001 Ruby小觀念與小技巧
Bruce Li
Más de Bruce Li
(15)
RSpec best practice - avoid using before and let
RSpec best practice - avoid using before and let
Unlock dependency between client teams and API team with API mock and proxy
Unlock dependency between client teams and API team with API mock and proxy
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Refactoring Workshop (Rails Pacific 2014)
Refactoring Workshop (Rails Pacific 2014)
011 優化時間分配的 app 跟心得
011 優化時間分配的 app 跟心得
Rails Code Club 3 @ Taipei
Rails Code Club 3 @ Taipei
Rails Code Club 2 @ Taipei
Rails Code Club 2 @ Taipei
010 Better and Better 工程師就業兩年多的心得雜談
010 Better and Better 工程師就業兩年多的心得雜談
009 增進效率的雜七雜八mac快速鍵與設定 part 2
009 增進效率的雜七雜八mac快速鍵與設定 part 2
008 vim超基礎入門
008 vim超基礎入門
007 Facebook Open Graph 相關開發簡單介紹 公開版
007 Facebook Open Graph 相關開發簡單介紹 公開版
004 動機 單純的力量 讀書心得
004 動機 單純的力量 讀書心得
003 Ruby小觀念與小技巧Part2
003 Ruby小觀念與小技巧Part2
002 增進效率的有的沒的快速鍵與設定
002 增進效率的有的沒的快速鍵與設定
001 Ruby小觀念與小技巧
001 Ruby小觀念與小技巧
Último
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
V3cube
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Roshan Dwivedi
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
Último
(20)
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
006 實作小玩具功能:chrome desktop notification
1.
實作小玩具功能 Chrome Desktop Notification Bruce 2012/7/13 雲端線上科技股份有限公司
2.
Desktop Notification
像這樣的:
3.
Require permission
必須綁在user操作(例如click)上 <script> $("#request-‐permission").click(function() { // 0 is PERMISSION_ALLOWED ↓ if (window.webkitNotifications.checkPermission() != 0) { window.webkitNotifications.requestPermission(); } }); </script>
4.
產生Notification <script> var
popup = window.webkitNotifications.createNotification( "icon.png", "greet", "hello world" ); popup.show(); </script>
5.
HTML Notification <script>
var popup = window.webkitNotifications.createHTMLNotification( "http://www.myoops.org/main.php" ); popup.show(); </script>
6.
替換notification
7.
替換notification
8.
替換notification <script> var
popup = window.webkitNotifications.createNotification( "icon.png", "greet", "hello world" ); popup.show(); 重點 popup.cancel(); popup = window.webkitNotifications.createNotification( "icon.png", "greet", "又⼀一則新訊息" ); popup.show(); </script>
9.
按⼀一下切換到該tab <script> var
popup = window.webkitNotifications.createNotification( "icon.png", "greet", "hello world" ); popup.onclick = function(){ window.focus(); popup.cancel(); } popup.show(); </script> 切換到該tab 順便把notification關掉
10.
播放音效 • 我還沒實作到這塊 • 原理是在
ondisplay event 播放聲音 • Google 是使用flash播放聲音
11.
Notification interface
interface Notification : EventTarget { // display methods void show(); void cancel(); // event handler attributes attribute Function ondisplay; attribute Function onerror; attribute Function onclose; attribute Function onclick; }
12.
官方API文件 • http://dev.chromium.org/developers/design-
documents/desktop-notifications/api- specification
Descargar ahora