SlideShare a Scribd company logo
1 of 18
FactPub Chrome Extension
- Developer’s Guide -
Genome Institute of Singapore
Sun Sagong 2017Feb27
What is FactPub Chrome Extension ?
• FactPub chrome extension is a browser extension that helps fact
donors to extract facts from PDF files on chrome browser and upload
them to FactPub website – http://factpub.org/
• FactPub aims to break down the paywall for academic papers by
uploading ‘facts’, not original copy-right protected PDF papers.
• A Java program, released under the name of Factify, is used to extract
facts from PDF. Thus the extension is designed to interact with it.
Factify - invisible process
Upload JSON file
FactPub Chrome Extension
background.js
- calls FactifyChrome.jar
General Architecture
Local User PC
FactPub - http://factpub.org/
Server side process
Extract facts
Passing PDF file
Send status notifications
Generate Page in WikiReturn page URL
Folder structure for FactPub chrome extension
Manifest file (JSON file)
Main code (JavaScript)
Manifest file – manifest.json (1/2)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/manifest.json#12-34
• Every chrome extension has a JSON-formatted manifest file that provides
important information to configure the extension.
Detailed explanation is given by Google - https://developer.chrome.com/extensions/manifest
Specify the files that are used when the extension icon is clicked.
Chose ‘background.js’ file as a main JavaScript code file.
Grant necessary permissions because chrome extension works
with limited API control for security reason.
Manifest file – manifest.json (2/2)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/manifest.json#1-15
• The first field of the manifest.json file - ‘key’ – is critical for modifying windows
registry to launch external program (Java) from chrome browser.
This hash value generate the folder name where
extension is going to be saved.
It must be always the same because installer – will be
explained later – need to write a folder location into
windows registry key.
Main code – background.js (1/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#26-41
• Upon installation, the instruction page is displayed and downloading of the Factify installer starts.
Main code – background.js (2/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#77-87
• Code to check whether the page being browsed is PDF file or not.
Get header information
Analyze header information
Main code – background.js (3/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#140-172
• Load page information whenever user browses a web page.
Using XMLHttpRequest background to handle page data
Detecting PDF
Sending user activity data to
server – e.g. page url
Main code – background.js (4/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#174-200
• Show desktop notification if the page is PDF
Creating desktop notification
message with some properties.
Detailed explanation is given by Google
https://developer.chrome.com/apps/notifications
Main code – background.js (5/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#245-270
• If user click the first button (Yes), starting extraction process by calling Factify
Serialize PDF data into JSON
format so Factify can
process it.
Pass data
Update desktop notification
message.
Main code – background.js (6/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#312-328
• The code within connectNativeApp() function – Establishing port with Chrome Extension
Establishing connection with Factify
Add an event listener for the time when
connection is closed.
Detailed explanation is given by Google
https://developer.chrome.com/extensions/nativeMessaging
Main code – background.js (7/7)
https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#376-401
• Adding event listener for receiving messages from Factify – This part is called when Factify send messages
Update desktop notification
messages based on statuses
resopnded by Factify
Installer
https://github.com/pauline-ng/factify_chrome_installer
• An extra step must be taken to call external program (Java) from chrome browser due to its security policy.
• This installer makes a necessary modification for windows registry to allow Native Messaging protocol between the extension and Java.
Codes for windows installer
Factify - it must be built as an external .jar
format and put under the root of
factify_chrome_installer folder as _factify.jar.
Main code for installer
Configuration files required to
run .jar from chrome browser
Installer – setup.nsi
https://github.com/pauline-ng/factify_chrome_installer/blob/master/install_scripts_win/setup.nsi
• Use NSIS (Nullsoft Scriptable Install System) for an windows installer builder - http://nsis.sourceforge.net/Simple_tutorials
Define registry key name and its values
Detailed explanation is given by Google
https://developer.chrome.com/extensions/nativeMessaging
The installer, including necessary
configuration files and _factify.jar.
Write necessary registry value to
specified registry key following
documents by Google.
Installer – setup.exe (How to build)
https://github.com/pauline-ng/factify_chrome_installer/blob/master/install_scripts_win/setup.nsi
• Just drug and drop NSI script file on NSI scripts compiler, then executable file will be created.
References for codes
• FactPub Chrome Extension – [JavaScript]
https://github.com/pauline-ng/factify_chrome_extension
• Installer of Factify – [Windows bat script & NSI script]
https://github.com/pauline-ng/factify_chrome_installer
• Factify – [Java]
https://github.com/pauline-ng/factify/blob/master/src/main/java/org/factpub/factify/ui/extension/chrome/FactifyChromeMain.java
Useful References for Chrome Extension
• Getting Started Tutorial for Chrome Extension Development
https://developer.chrome.com/extensions/getstarted
• Desktop Notifications
https://developer.chrome.com/apps/notifications
• Native Messaging Protocol
https://developer.chrome.com/extensions/nativeMessaging

More Related Content

What's hot

PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsAlessandro Pilotti
 
Browser Exploitation Framework Tutorial
Browser Exploitation Framework TutorialBrowser Exploitation Framework Tutorial
Browser Exploitation Framework Tutorialimlaurel2
 
Php Performance On Windows
Php Performance On WindowsPhp Performance On Windows
Php Performance On Windowsruslany
 
PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008Krit Kamtuo
 
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, PortugalFirefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, PortugalRobert Nyman
 
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coreTYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coretimohund
 
The state of packaged web apps
The state of packaged web appsThe state of packaged web apps
The state of packaged web appsCristiano Betta
 
Php framework at BarCampPP
Php framework at BarCampPPPhp framework at BarCampPP
Php framework at BarCampPPpsophy
 
Get happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend ConfigurationGet happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend ConfigurationPeter Kraume
 
Link. apache wicket [santi caltabiano]
  Link. apache wicket [santi caltabiano]  Link. apache wicket [santi caltabiano]
Link. apache wicket [santi caltabiano]santi caltabiano
 

What's hot (13)

PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
 
Browser Exploitation Framework Tutorial
Browser Exploitation Framework TutorialBrowser Exploitation Framework Tutorial
Browser Exploitation Framework Tutorial
 
Php Performance On Windows
Php Performance On WindowsPhp Performance On Windows
Php Performance On Windows
 
PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008PHP Enhancement with Windows Server 2008
PHP Enhancement with Windows Server 2008
 
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, PortugalFirefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
 
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coreTYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
 
Plugins
PluginsPlugins
Plugins
 
Firefox
FirefoxFirefox
Firefox
 
Docker Usage
Docker UsageDocker Usage
Docker Usage
 
The state of packaged web apps
The state of packaged web appsThe state of packaged web apps
The state of packaged web apps
 
Php framework at BarCampPP
Php framework at BarCampPPPhp framework at BarCampPP
Php framework at BarCampPP
 
Get happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend ConfigurationGet happy Editors with a suitable TYPO3 Backend Configuration
Get happy Editors with a suitable TYPO3 Backend Configuration
 
Link. apache wicket [santi caltabiano]
  Link. apache wicket [santi caltabiano]  Link. apache wicket [santi caltabiano]
Link. apache wicket [santi caltabiano]
 

Viewers also liked

Location Brand Equity Model - Dissertation
Location Brand Equity Model - DissertationLocation Brand Equity Model - Dissertation
Location Brand Equity Model - DissertationSusanne Jeppsson
 
Editing process
Editing processEditing process
Editing process19rsg30cc
 
Információs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztésInformációs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztésZoffia
 
процессы передачи информации
процессы передачи информациипроцессы передачи информации
процессы передачи информацииazamatik1988
 
Rola Andony Hanania
Rola Andony HananiaRola Andony Hanania
Rola Andony HananiaRolaHanania
 
Információs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztésInformációs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztésZoffia
 
Q6 what have you learned
Q6   what have you learnedQ6   what have you learned
Q6 what have you learned19rsg30cc
 
Target audience
Target audienceTarget audience
Target audience19rsg30cc
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 

Viewers also liked (16)

Location Brand Equity Model - Dissertation
Location Brand Equity Model - DissertationLocation Brand Equity Model - Dissertation
Location Brand Equity Model - Dissertation
 
Editing process
Editing processEditing process
Editing process
 
Információs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztésInformációs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztés
 
процессы передачи информации
процессы передачи информациипроцессы передачи информации
процессы передачи информации
 
09.elyana nugraheni
09.elyana nugraheni09.elyana nugraheni
09.elyana nugraheni
 
Rola Andony Hanania
Rola Andony HananiaRola Andony Hanania
Rola Andony Hanania
 
Work today
Work todayWork today
Work today
 
Információs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztésInformációs társadalom és intézményfejlesztés
Információs társadalom és intézményfejlesztés
 
Q6 what have you learned
Q6   what have you learnedQ6   what have you learned
Q6 what have you learned
 
El diurético
El diuréticoEl diurético
El diurético
 
Presentation1
Presentation1Presentation1
Presentation1
 
Target audience
Target audienceTarget audience
Target audience
 
media teknologi
media teknologimedia teknologi
media teknologi
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Rola A Hanania
Rola A HananiaRola A Hanania
Rola A Hanania
 
Oktoberfest
OktoberfestOktoberfest
Oktoberfest
 

Similar to FactPub Chrome Extension - Developer's Guide -

Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material designSrinadh Kanugala
 
Asp net mvc
Asp net mvcAsp net mvc
Asp net mvcbgrynko
 
Widgets Tools and Doodads for Webmasters - CIL 2008
Widgets Tools and Doodads for Webmasters - CIL 2008Widgets Tools and Doodads for Webmasters - CIL 2008
Widgets Tools and Doodads for Webmasters - CIL 2008Darlene Fichter
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introductionVictor Zhang
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartEric Overfield
 
Supply Chain Security for Containerised Workloads - Lee Chuk Munn
Supply Chain Security for Containerised Workloads - Lee Chuk MunnSupply Chain Security for Containerised Workloads - Lee Chuk Munn
Supply Chain Security for Containerised Workloads - Lee Chuk MunnNUS-ISS
 
Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Iron Speed
 
Build Database Applications for SharePoint
Build Database Applications for SharePointBuild Database Applications for SharePoint
Build Database Applications for SharePointIron Speed
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization modelEuropean Collaboration Summit
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & ExtensionsVarun Raj
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsRock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsAOE
 
Front End performance as a Continuous Integration - Part1
Front End performance as a Continuous Integration - Part1Front End performance as a Continuous Integration - Part1
Front End performance as a Continuous Integration - Part1Tarence DSouza
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guidevjvarenya
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
mago3D Technical Workshop Material
mago3D Technical Workshop Material mago3D Technical Workshop Material
mago3D Technical Workshop Material SANGHEE SHIN
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 

Similar to FactPub Chrome Extension - Developer's Guide - (20)

IIS Web Ecosystem
IIS Web EcosystemIIS Web Ecosystem
IIS Web Ecosystem
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
 
Asp net mvc
Asp net mvcAsp net mvc
Asp net mvc
 
Heroku pycon
Heroku pyconHeroku pycon
Heroku pycon
 
Widgets Tools and Doodads for Webmasters - CIL 2008
Widgets Tools and Doodads for Webmasters - CIL 2008Widgets Tools and Doodads for Webmasters - CIL 2008
Widgets Tools and Doodads for Webmasters - CIL 2008
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introduction
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
 
Supply Chain Security for Containerised Workloads - Lee Chuk Munn
Supply Chain Security for Containerised Workloads - Lee Chuk MunnSupply Chain Security for Containerised Workloads - Lee Chuk Munn
Supply Chain Security for Containerised Workloads - Lee Chuk Munn
 
Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Build Database Applications for SharePoint!
Build Database Applications for SharePoint!
 
Build Database Applications for SharePoint
Build Database Applications for SharePointBuild Database Applications for SharePoint
Build Database Applications for SharePoint
 
Evilgrade Defcon 18 2010
Evilgrade Defcon 18 2010Evilgrade Defcon 18 2010
Evilgrade Defcon 18 2010
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsRock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
 
Front End performance as a Continuous Integration - Part1
Front End performance as a Continuous Integration - Part1Front End performance as a Continuous Integration - Part1
Front End performance as a Continuous Integration - Part1
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
mago3D Technical Workshop Material
mago3D Technical Workshop Material mago3D Technical Workshop Material
mago3D Technical Workshop Material
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 

Recently uploaded

Call Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
World Press Freedom Day 2024; May 3rd - Poster
World Press Freedom Day 2024; May 3rd - PosterWorld Press Freedom Day 2024; May 3rd - Poster
World Press Freedom Day 2024; May 3rd - PosterChristina Parmionova
 
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
1935 CONSTITUTION REPORT IN RIPH FINALLS
1935 CONSTITUTION REPORT IN RIPH FINALLS1935 CONSTITUTION REPORT IN RIPH FINALLS
1935 CONSTITUTION REPORT IN RIPH FINALLSarandianics
 
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...MOHANI PANDEY
 
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...ranjana rawat
 
The Economic and Organised Crime Office (EOCO) has been advised by the Office...
The Economic and Organised Crime Office (EOCO) has been advised by the Office...The Economic and Organised Crime Office (EOCO) has been advised by the Office...
The Economic and Organised Crime Office (EOCO) has been advised by the Office...nservice241
 
Postal Ballots-For home voting step by step process 2024.pptx
Postal Ballots-For home voting step by step process 2024.pptxPostal Ballots-For home voting step by step process 2024.pptx
Postal Ballots-For home voting step by step process 2024.pptxSwastiRanjanNayak
 
best call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakur
best call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakurbest call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakur
best call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha ThakurSUHANI PANDEY
 
2024: The FAR, Federal Acquisition Regulations, Part 30
2024: The FAR, Federal Acquisition Regulations, Part 302024: The FAR, Federal Acquisition Regulations, Part 30
2024: The FAR, Federal Acquisition Regulations, Part 30JSchaus & Associates
 
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORSPPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORSgovindsharma81649
 
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...SUHANI PANDEY
 
TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...
TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...
TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...robinsonayot
 
Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024ARCResearch
 
Chakan ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Chakan ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Chakan ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Chakan ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...tanu pandey
 
Election 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdfElection 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdfSamirsinh Parmar
 
Scaling up coastal adaptation in Maldives through the NAP process
Scaling up coastal adaptation in Maldives through the NAP processScaling up coastal adaptation in Maldives through the NAP process
Scaling up coastal adaptation in Maldives through the NAP processNAP Global Network
 
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...tanu pandey
 
Booking open Available Pune Call Girls Shukrawar Peth 6297143586 Call Hot In...
Booking open Available Pune Call Girls Shukrawar Peth  6297143586 Call Hot In...Booking open Available Pune Call Girls Shukrawar Peth  6297143586 Call Hot In...
Booking open Available Pune Call Girls Shukrawar Peth 6297143586 Call Hot In...tanu pandey
 
Top Rated Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

Call Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sangamwadi Call Me 7737669865 Budget Friendly No Advance Booking
 
World Press Freedom Day 2024; May 3rd - Poster
World Press Freedom Day 2024; May 3rd - PosterWorld Press Freedom Day 2024; May 3rd - Poster
World Press Freedom Day 2024; May 3rd - Poster
 
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
1935 CONSTITUTION REPORT IN RIPH FINALLS
1935 CONSTITUTION REPORT IN RIPH FINALLS1935 CONSTITUTION REPORT IN RIPH FINALLS
1935 CONSTITUTION REPORT IN RIPH FINALLS
 
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
 
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
 
The Economic and Organised Crime Office (EOCO) has been advised by the Office...
The Economic and Organised Crime Office (EOCO) has been advised by the Office...The Economic and Organised Crime Office (EOCO) has been advised by the Office...
The Economic and Organised Crime Office (EOCO) has been advised by the Office...
 
Postal Ballots-For home voting step by step process 2024.pptx
Postal Ballots-For home voting step by step process 2024.pptxPostal Ballots-For home voting step by step process 2024.pptx
Postal Ballots-For home voting step by step process 2024.pptx
 
best call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakur
best call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakurbest call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakur
best call girls in Pune - 450+ Call Girl Cash Payment 8005736733 Neha Thakur
 
2024: The FAR, Federal Acquisition Regulations, Part 30
2024: The FAR, Federal Acquisition Regulations, Part 302024: The FAR, Federal Acquisition Regulations, Part 30
2024: The FAR, Federal Acquisition Regulations, Part 30
 
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORSPPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
 
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
VIP Model Call Girls Lohegaon ( Pune ) Call ON 8005736733 Starting From 5K to...
 
TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...
TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...
TEST BANK For Essentials of Negotiation, 7th Edition by Roy Lewicki, Bruce Ba...
 
Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024
 
Chakan ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Chakan ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Chakan ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Chakan ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
Election 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdfElection 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdf
 
Scaling up coastal adaptation in Maldives through the NAP process
Scaling up coastal adaptation in Maldives through the NAP processScaling up coastal adaptation in Maldives through the NAP process
Scaling up coastal adaptation in Maldives through the NAP process
 
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
 
Booking open Available Pune Call Girls Shukrawar Peth 6297143586 Call Hot In...
Booking open Available Pune Call Girls Shukrawar Peth  6297143586 Call Hot In...Booking open Available Pune Call Girls Shukrawar Peth  6297143586 Call Hot In...
Booking open Available Pune Call Girls Shukrawar Peth 6297143586 Call Hot In...
 
Top Rated Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 

FactPub Chrome Extension - Developer's Guide -

  • 1. FactPub Chrome Extension - Developer’s Guide - Genome Institute of Singapore Sun Sagong 2017Feb27
  • 2. What is FactPub Chrome Extension ? • FactPub chrome extension is a browser extension that helps fact donors to extract facts from PDF files on chrome browser and upload them to FactPub website – http://factpub.org/ • FactPub aims to break down the paywall for academic papers by uploading ‘facts’, not original copy-right protected PDF papers. • A Java program, released under the name of Factify, is used to extract facts from PDF. Thus the extension is designed to interact with it.
  • 3. Factify - invisible process Upload JSON file FactPub Chrome Extension background.js - calls FactifyChrome.jar General Architecture Local User PC FactPub - http://factpub.org/ Server side process Extract facts Passing PDF file Send status notifications Generate Page in WikiReturn page URL
  • 4. Folder structure for FactPub chrome extension Manifest file (JSON file) Main code (JavaScript)
  • 5. Manifest file – manifest.json (1/2) https://github.com/pauline-ng/factify_chrome_extension/blob/master/manifest.json#12-34 • Every chrome extension has a JSON-formatted manifest file that provides important information to configure the extension. Detailed explanation is given by Google - https://developer.chrome.com/extensions/manifest Specify the files that are used when the extension icon is clicked. Chose ‘background.js’ file as a main JavaScript code file. Grant necessary permissions because chrome extension works with limited API control for security reason.
  • 6. Manifest file – manifest.json (2/2) https://github.com/pauline-ng/factify_chrome_extension/blob/master/manifest.json#1-15 • The first field of the manifest.json file - ‘key’ – is critical for modifying windows registry to launch external program (Java) from chrome browser. This hash value generate the folder name where extension is going to be saved. It must be always the same because installer – will be explained later – need to write a folder location into windows registry key.
  • 7. Main code – background.js (1/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#26-41 • Upon installation, the instruction page is displayed and downloading of the Factify installer starts.
  • 8. Main code – background.js (2/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#77-87 • Code to check whether the page being browsed is PDF file or not. Get header information Analyze header information
  • 9. Main code – background.js (3/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#140-172 • Load page information whenever user browses a web page. Using XMLHttpRequest background to handle page data Detecting PDF Sending user activity data to server – e.g. page url
  • 10. Main code – background.js (4/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#174-200 • Show desktop notification if the page is PDF Creating desktop notification message with some properties. Detailed explanation is given by Google https://developer.chrome.com/apps/notifications
  • 11. Main code – background.js (5/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#245-270 • If user click the first button (Yes), starting extraction process by calling Factify Serialize PDF data into JSON format so Factify can process it. Pass data Update desktop notification message.
  • 12. Main code – background.js (6/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#312-328 • The code within connectNativeApp() function – Establishing port with Chrome Extension Establishing connection with Factify Add an event listener for the time when connection is closed. Detailed explanation is given by Google https://developer.chrome.com/extensions/nativeMessaging
  • 13. Main code – background.js (7/7) https://github.com/pauline-ng/factify_chrome_extension/blob/master/background.js#376-401 • Adding event listener for receiving messages from Factify – This part is called when Factify send messages Update desktop notification messages based on statuses resopnded by Factify
  • 14. Installer https://github.com/pauline-ng/factify_chrome_installer • An extra step must be taken to call external program (Java) from chrome browser due to its security policy. • This installer makes a necessary modification for windows registry to allow Native Messaging protocol between the extension and Java. Codes for windows installer Factify - it must be built as an external .jar format and put under the root of factify_chrome_installer folder as _factify.jar. Main code for installer Configuration files required to run .jar from chrome browser
  • 15. Installer – setup.nsi https://github.com/pauline-ng/factify_chrome_installer/blob/master/install_scripts_win/setup.nsi • Use NSIS (Nullsoft Scriptable Install System) for an windows installer builder - http://nsis.sourceforge.net/Simple_tutorials Define registry key name and its values Detailed explanation is given by Google https://developer.chrome.com/extensions/nativeMessaging The installer, including necessary configuration files and _factify.jar. Write necessary registry value to specified registry key following documents by Google.
  • 16. Installer – setup.exe (How to build) https://github.com/pauline-ng/factify_chrome_installer/blob/master/install_scripts_win/setup.nsi • Just drug and drop NSI script file on NSI scripts compiler, then executable file will be created.
  • 17. References for codes • FactPub Chrome Extension – [JavaScript] https://github.com/pauline-ng/factify_chrome_extension • Installer of Factify – [Windows bat script & NSI script] https://github.com/pauline-ng/factify_chrome_installer • Factify – [Java] https://github.com/pauline-ng/factify/blob/master/src/main/java/org/factpub/factify/ui/extension/chrome/FactifyChromeMain.java
  • 18. Useful References for Chrome Extension • Getting Started Tutorial for Chrome Extension Development https://developer.chrome.com/extensions/getstarted • Desktop Notifications https://developer.chrome.com/apps/notifications • Native Messaging Protocol https://developer.chrome.com/extensions/nativeMessaging