Creating Google Chrome Extensions [1st ed. 2016] 9781484217740, 9781484217757, 1484217748, 1484217756

Transform your existing web applications into Google Chrome browser extensions and create brand new extensions that impr

404 86 2MB

English Pages 167 [183] Year 2016

Report DMCA / Copyright

DOWNLOAD FILE

Creating Google Chrome Extensions [1st ed. 2016]
 9781484217740, 9781484217757, 1484217748, 1484217756

Table of contents :
Contents at a Glance......Page 6
Contents......Page 8
About the Author......Page 12
About the Technical Reviewer......Page 14
Acknowledgments......Page 16
Introduction......Page 18
Support for Browser Extensions......Page 19
Extensions Are Not Plug-ins......Page 20
Extensions and Plug-ins......Page 21
Notable Examples......Page 22
Adding Extensions from the Store......Page 23
Extensions API......Page 26
Creating Your First Extension......Page 27
Validating a JSON File......Page 29
Adding the Button: Browser-Action......Page 30
Loading the Extension Folder......Page 33
Debugging an Extension......Page 35
Inspecting the Popup......Page 36
Sources and Resources Panel......Page 37
Console Panel......Page 39
Distributing on Store......Page 40
Summary......Page 51
Components Involved in Creating Chrome Extensions......Page 52
Extension Runtime......Page 57
Scripts Representing the Runtime......Page 58
The Browser-Action and Page-Action Components......Page 59
Role of the Manifest for This Component......Page 60
Defining the Component......Page 61
Shortcut Key or Command......Page 63
The onCommand Event......Page 66
Event Scripts......Page 67
The Need for Event Scripts......Page 68
Role of the Manifest for This Component......Page 70
Background Scripts......Page 72
Event Objects......Page 73
Declarative Event Handlers......Page 74
The HelloPageAction Extension......Page 75
The declarativeContent API......Page 76
Adding and Removing Rules......Page 77
Using ShowPageAction......Page 78
Content Scripts......Page 79
Role of the Manifest for This Component......Page 80
HelloContentScript Extension......Page 82
BrowserActionNotes Extension......Page 85
PageActionNotes Extension......Page 91
Summary......Page 94
Omnibox Inputs......Page 95
Role of an Event Script for this Component......Page 97
Context Menu Items......Page 101
Creating an Item......Page 102
Revisiting Content-UI......Page 106
The HelloContentUI Extension......Page 107
Messaging for Communication......Page 110
APIs and Events......Page 111
Web Page Scripts and Event Scripts......Page 112
Listening to the Event......Page 114
Role of the Manifest for This API......Page 116
Using Long-Lived Connections......Page 117
Content Scripts and Event Scripts......Page 119
Popup Scripts and Content Scripts......Page 123
Using a Long-lived Connection......Page 126
Content Scripts and Web Page Scripts......Page 127
Popup Scripts and Event Scripts......Page 131
Google Chrome Extensions APIs......Page 133
An Example of Permissions......Page 134
APIs Requiring Permissions......Page 135
Alarms API......Page 137
Bookmarks API......Page 140
Creating a Bookmark......Page 141
Updating a Bookmark......Page 142
Using the Bookmarks Hierarchy......Page 143
Downloads API......Page 144
Downloading a File......Page 145
Associated Events......Page 147
History API......Page 148
Adding and Removing URLs......Page 149
Notifications API......Page 150
Creating and Clearing a Notification......Page 152
Sync versus Local Storage......Page 153
Tabs API......Page 155
Updating a Tab......Page 157
XHR API......Page 158
Summary......Page 160
Role of Manifest for this Component......Page 161
Writing an Options Page......Page 162
Working with Override Pages......Page 165
OverridePages Extension......Page 167
Creating Themes for Google Chrome......Page 171
Storage......Page 176
Content Script......Page 177
Summary......Page 178
Index......Page 179

Polecaj historie