SlideShare a Scribd company logo
With a Chrome Extension and Chrome Native Messaging
How to connect 1980 and
2018
Matthieu KERN
matthieu.kern@doctolib.com
@MatthieuKern
Quentin MÉNORET
quentin.menoret@doctolib.com
@QuentinMenoret
Goal
Make our users feel like they have
only one software
A chrome extension
Our solution
Connecting 2000
What we’re building
● A chrome extension that allow to exchange messages between
Doctolib and the PMS
● Three topics should be addressed:
○ Have buttons into each software to trigger actions in the other
○ Allow to switch the focus
○ Synchronise data
Zipper
Actions
Temporality
Appointment booking
(online, by phone, update/cancellation)
1
Welcoming of the patient
(identity validation and waiting room management)
2
Rebook an appointment8
Billing6
Remote transmission7
Consultation: medical prescription5
Consultation: medical data seizure4
Medical and administrative records seizure with or
without insurance card
3
Messaging System
Background Script
Content Script
(Doctolib)
Content Script
(PMS)
Injected Script
(Doctolib)
Injected Script
(PMS)
Chrome Extension
PMS PageDoctolib Page
PostMessage PostMessage
Chrome Messaging Chrome Messaging
Background script
● The code that runs in chrome, not in a specific tab
● It is where we put all the “routing” and “logic” stuff
● It can do magic stuff using the chrome API, such as focusing a tab
Content script
● It is injected on a tab based on the URL
● Shares the context of the website
● Have access to the DOM, but not to the window object
Communication between components
● To communicate between Content Scripts and Background Scripts:
● Chrome messaging
● To communicate between the PMS and Content Scripts:
● window.postMessage
The window
postMessage API
Communication between the page
and the content script
Content Script
Page Script
The Chrome
Messaging API
Communication between content
scripts and background script
Background Script
Content Script
How it looks like for
the partner
Communication between the
partner and Doctolib
The partner code
Plug&Play API vs REST API
● Focus switches
● Frontend synchronization
● No need for a specific backend API
How to test ?
● No possibility for Headless
● But you can use a platform such as Browserstack
● Selenium or puppeteer would work just fine
Connecting 1980
Context: The Case of Desktop Softwares
● Half of our customers are using a desktop software (the Internet did not exist in
1980)
● We need to connect them as well
● Most of desktop softwares are old and bloated, we need a simple API
Communication With The Software
Chrome Native Messaging
● API provided by Google Chrome and implemented by most browsers
● A way to exchange messages with a program installed on the user computer
● API similar to other message passing APIs provided by Chrome
● Chrome starts the native host on a separate process
● It communicates using standard input and standard output, sending and
receiving serialized JSON preceded by the length of the message (using a 32-bit
native integer)
Chrome Native
Messaging:
Sending a Message
● Connects to a native host
using connectNative
method
● Use the postMessage
method to send a message to
native host
Chrome Native
Messaging:
Receiving a Message
Adding listeners:
● on onMessageto handle
messages received from
native host
● on onDisconnectto catch
native host disconnection
Chrome Native
Messaging:
The Manifest File
● The file that defines the
configuration of the bridge
● Path defined by a registry key
on Windows, specific paths
on Linux and Mac
Packaging a Binary
With Pkg
● Node.JS binary packager
developed by Zeit
● Cross-compilation, easy to
install and use
Packaging a Binary With Pkg: How it Works
● Uses pre-compiled base node binaries with some patches applied
● Transforms javascript code into bytecode
● Snapshot filesystem: all files are embedded in the binary and prefixed by
/snapshot/, the program have access to the snapshot file system during runtime
● Targets:
○ node version
○ platform: windows, mac, linux or bsd
○ architecture: x64, x86, armv6 or armv7
○ all targets available in the pkg-fetch last release:
https://github.com/zeit/pkg-fetch/releases/tag/v2.5
Testing
● Using Jest for unit and integration tests
○ All the code is unit tested
○ Integration tests fakes the PMS and Chrome to assert an output when an
input is given
○ Installer tests runs installers on Windows to check that all files are
correctly deployed
● A lot of snapshot testing
An Example of Integration Test
Spawning of the Zipper Desktop Process
Connection of the Fake Socket
An Actual Socket
Test
Resources
● https://developer.mozilla.org/fr/docs/Web/API/Window/postMessage: window postMessage documentation
● https://developer.chrome.com/apps/messaging: Chrome messaging documentation
● https://developer.chrome.com/extensions/content_scripts: Content scripts documentation
● https://www.browserstack.com/: Platform for running e2e tests on VM
● https://developer.chrome.com/extensions/background_pages: Background scripts
● https://developer.chrome.com/apps/nativeMessaging: Chrome Native Messaging documentation
● https://github.com/zeit/pkg: Pkg documentation
● http://nsis.sourceforge.net/Main_Page: NSIS documentation
● http://www.grivet-tools.com/blog/2014/build-simple-pkg-pkgbuild/: How to use pkgbuild
● https://jestjs.io/: Jest test framework
Matthieu KERN
matthieu.kern@doctolib.com
@MatthieuKern
Quentin MÉNORET
quentin.menoret@doctolib.com
@QuentinMenoret
We are hiring! https://careers.doctolib.fr/engineering/

More Related Content

What's hot

MuleSoft Slack Integration - meetup
MuleSoft Slack Integration - meetupMuleSoft Slack Integration - meetup
MuleSoft Slack Integration - meetup
Karthik Venkata T
 
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopmentAhmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
Shekh Muenuddeen
 
How Secure is Your API?
How Secure is Your API?How Secure is Your API?
How Secure is Your API?
Mary Joy Sabal
 
How to keep modules up to date
How to keep modules up to dateHow to keep modules up to date
How to keep modules up to date
Thomas Fleck
 
Vagrant and Docker
Vagrant and DockerVagrant and Docker
Vagrant and Docker
Nascenia IT
 
Workspace on asp.net web aplication development
Workspace on asp.net  web aplication developmentWorkspace on asp.net  web aplication development
Workspace on asp.net web aplication development
KBA Systems
 
20210916 mule soft_meetup_nz_online_uploadedversion
20210916 mule soft_meetup_nz_online_uploadedversion20210916 mule soft_meetup_nz_online_uploadedversion
20210916 mule soft_meetup_nz_online_uploadedversion
MizuhoHoshino
 
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
Angel Alberici
 
Lightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using EventsLightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using Events
Nishant Singh Panwar
 
Behaviour Driven Development Hands-on
Behaviour Driven Development Hands-onBehaviour Driven Development Hands-on
Behaviour Driven Development Hands-on
Hemmerling
 
Test Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShellTest Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShell
Hemmerling
 
Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
D.Rajesh Kumar
 

What's hot (12)

MuleSoft Slack Integration - meetup
MuleSoft Slack Integration - meetupMuleSoft Slack Integration - meetup
MuleSoft Slack Integration - meetup
 
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopmentAhmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
 
How Secure is Your API?
How Secure is Your API?How Secure is Your API?
How Secure is Your API?
 
How to keep modules up to date
How to keep modules up to dateHow to keep modules up to date
How to keep modules up to date
 
Vagrant and Docker
Vagrant and DockerVagrant and Docker
Vagrant and Docker
 
Workspace on asp.net web aplication development
Workspace on asp.net  web aplication developmentWorkspace on asp.net  web aplication development
Workspace on asp.net web aplication development
 
20210916 mule soft_meetup_nz_online_uploadedversion
20210916 mule soft_meetup_nz_online_uploadedversion20210916 mule soft_meetup_nz_online_uploadedversion
20210916 mule soft_meetup_nz_online_uploadedversion
 
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
 
Lightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using EventsLightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using Events
 
Behaviour Driven Development Hands-on
Behaviour Driven Development Hands-onBehaviour Driven Development Hands-on
Behaviour Driven Development Hands-on
 
Test Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShellTest Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShell
 
Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
 

Similar to How to connect 1980 and 2018

Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
VMware Tanzu
 
Resume
ResumeResume
Resume
Sanny Singh
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In Soa
WSO2
 
Zing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectZing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat Architect
Chau Thanh
 
COM+ & MSMQ
COM+ & MSMQCOM+ & MSMQ
COM+ & MSMQ
G Srinivasan
 
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
Amir Zmora
 
What do you need to know about g rpc on .net
What do you need to know about g rpc on .net What do you need to know about g rpc on .net
What do you need to know about g rpc on .net
Moon Technolabs Pvt. Ltd.
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Tim Burks
 
MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...
MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...
MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...
MongoDB
 
Presentation on Application layer_201.pdf
Presentation on Application layer_201.pdfPresentation on Application layer_201.pdf
Presentation on Application layer_201.pdf
prince2412001
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
Red Hat
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
Chris Schalk
 
Bootcamp Introduction.pptx
Bootcamp Introduction.pptxBootcamp Introduction.pptx
Bootcamp Introduction.pptx
AyanMurmu
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
Kazuhiro Ogura
 
0nline shopping
0nline shopping0nline shopping
0nline shopping
ankit dubey
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
Mosaab Ehab
 
DevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheusDevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
wesley chun
 
Introduction to Modern DevOps Technologies
Introduction to  Modern DevOps TechnologiesIntroduction to  Modern DevOps Technologies
Introduction to Modern DevOps Technologies
Kriangkrai Chaonithi
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?
LOGINPHP360
 

Similar to How to connect 1980 and 2018 (20)

Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
Upgrade your InfoSec, Ops and Dev teams with PCF 1.12
 
Resume
ResumeResume
Resume
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In Soa
 
Zing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectZing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat Architect
 
COM+ & MSMQ
COM+ & MSMQCOM+ & MSMQ
COM+ & MSMQ
 
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
WebRTC Live Q&A Session #5 - JavaScript Promises and WebRTC Interoperability ...
 
What do you need to know about g rpc on .net
What do you need to know about g rpc on .net What do you need to know about g rpc on .net
What do you need to know about g rpc on .net
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...
MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...
MongoDB World 2018: Building Serverless Apps with MongoDB Atlas on Google Clo...
 
Presentation on Application layer_201.pdf
Presentation on Application layer_201.pdfPresentation on Application layer_201.pdf
Presentation on Application layer_201.pdf
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
 
Bootcamp Introduction.pptx
Bootcamp Introduction.pptxBootcamp Introduction.pptx
Bootcamp Introduction.pptx
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
 
0nline shopping
0nline shopping0nline shopping
0nline shopping
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
 
DevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheusDevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheus
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
 
Introduction to Modern DevOps Technologies
Introduction to  Modern DevOps TechnologiesIntroduction to  Modern DevOps Technologies
Introduction to Modern DevOps Technologies
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?
 

Recently uploaded

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
ukwwuq
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
AanSulistiyo
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 

Recently uploaded (20)

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 

How to connect 1980 and 2018

  • 1. With a Chrome Extension and Chrome Native Messaging How to connect 1980 and 2018
  • 3. Goal Make our users feel like they have only one software
  • 6. What we’re building ● A chrome extension that allow to exchange messages between Doctolib and the PMS ● Three topics should be addressed: ○ Have buttons into each software to trigger actions in the other ○ Allow to switch the focus ○ Synchronise data
  • 7.
  • 8. Zipper Actions Temporality Appointment booking (online, by phone, update/cancellation) 1 Welcoming of the patient (identity validation and waiting room management) 2 Rebook an appointment8 Billing6 Remote transmission7 Consultation: medical prescription5 Consultation: medical data seizure4 Medical and administrative records seizure with or without insurance card 3 Messaging System
  • 9. Background Script Content Script (Doctolib) Content Script (PMS) Injected Script (Doctolib) Injected Script (PMS) Chrome Extension PMS PageDoctolib Page PostMessage PostMessage Chrome Messaging Chrome Messaging
  • 10. Background script ● The code that runs in chrome, not in a specific tab ● It is where we put all the “routing” and “logic” stuff ● It can do magic stuff using the chrome API, such as focusing a tab
  • 11. Content script ● It is injected on a tab based on the URL ● Shares the context of the website ● Have access to the DOM, but not to the window object
  • 12. Communication between components ● To communicate between Content Scripts and Background Scripts: ● Chrome messaging ● To communicate between the PMS and Content Scripts: ● window.postMessage
  • 13. The window postMessage API Communication between the page and the content script Content Script Page Script
  • 14. The Chrome Messaging API Communication between content scripts and background script Background Script Content Script
  • 15. How it looks like for the partner Communication between the partner and Doctolib The partner code
  • 16. Plug&Play API vs REST API ● Focus switches ● Frontend synchronization ● No need for a specific backend API
  • 17. How to test ? ● No possibility for Headless ● But you can use a platform such as Browserstack ● Selenium or puppeteer would work just fine
  • 19. Context: The Case of Desktop Softwares ● Half of our customers are using a desktop software (the Internet did not exist in 1980) ● We need to connect them as well ● Most of desktop softwares are old and bloated, we need a simple API
  • 21. Chrome Native Messaging ● API provided by Google Chrome and implemented by most browsers ● A way to exchange messages with a program installed on the user computer ● API similar to other message passing APIs provided by Chrome ● Chrome starts the native host on a separate process ● It communicates using standard input and standard output, sending and receiving serialized JSON preceded by the length of the message (using a 32-bit native integer)
  • 22. Chrome Native Messaging: Sending a Message ● Connects to a native host using connectNative method ● Use the postMessage method to send a message to native host
  • 23. Chrome Native Messaging: Receiving a Message Adding listeners: ● on onMessageto handle messages received from native host ● on onDisconnectto catch native host disconnection
  • 24. Chrome Native Messaging: The Manifest File ● The file that defines the configuration of the bridge ● Path defined by a registry key on Windows, specific paths on Linux and Mac
  • 25. Packaging a Binary With Pkg ● Node.JS binary packager developed by Zeit ● Cross-compilation, easy to install and use
  • 26. Packaging a Binary With Pkg: How it Works ● Uses pre-compiled base node binaries with some patches applied ● Transforms javascript code into bytecode ● Snapshot filesystem: all files are embedded in the binary and prefixed by /snapshot/, the program have access to the snapshot file system during runtime ● Targets: ○ node version ○ platform: windows, mac, linux or bsd ○ architecture: x64, x86, armv6 or armv7 ○ all targets available in the pkg-fetch last release: https://github.com/zeit/pkg-fetch/releases/tag/v2.5
  • 27. Testing ● Using Jest for unit and integration tests ○ All the code is unit tested ○ Integration tests fakes the PMS and Chrome to assert an output when an input is given ○ Installer tests runs installers on Windows to check that all files are correctly deployed ● A lot of snapshot testing
  • 28. An Example of Integration Test
  • 29. Spawning of the Zipper Desktop Process
  • 30. Connection of the Fake Socket
  • 32. Resources ● https://developer.mozilla.org/fr/docs/Web/API/Window/postMessage: window postMessage documentation ● https://developer.chrome.com/apps/messaging: Chrome messaging documentation ● https://developer.chrome.com/extensions/content_scripts: Content scripts documentation ● https://www.browserstack.com/: Platform for running e2e tests on VM ● https://developer.chrome.com/extensions/background_pages: Background scripts ● https://developer.chrome.com/apps/nativeMessaging: Chrome Native Messaging documentation ● https://github.com/zeit/pkg: Pkg documentation ● http://nsis.sourceforge.net/Main_Page: NSIS documentation ● http://www.grivet-tools.com/blog/2014/build-simple-pkg-pkgbuild/: How to use pkgbuild ● https://jestjs.io/: Jest test framework