You are on page 1of 54

2102

2104

.



" ".

.0 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

0. 0 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.1 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.0 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.2 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chrome Extensiones

2.0 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.5 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.3 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.0 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . API

3.2 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.3 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . :Synchronized Storage Local Storage

4.3 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Content Script Background Script

3.5 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Message Passing

3.6 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Badges

3.7 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.4
23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.0 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chrome Web Store

4.2
24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.3 22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.4 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5 / 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6

.5 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.0
/ 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.2 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . In-App Payments

5.4 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Google AdSense

5.3 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.1

1. 1

( ...)

.

(
)

.

2.1
:

:HTML -
Hyper Text Markup Language .
:CSS -
. HTML CSS
.
:JavaScript -

.

JavaScript .

:JSON - JavaScript Object Notation .


:XML - Extensible Markup Language
. JSON XML

| 1
3.1

:






(
5

)
( )

| 2
.2 Chrome Extensiones

2.1

.
.


Android iOS .

2.2
:

:Browser Action - 1
2.2.0
.

2.2.1 Browser Action

:Page Action - 2 2.2.2



.

| 3
2.2.2 Page Action


() .Browser Action

- 3 :
.

2.3


!
! :

- 2 () ( )More Tools (
)Extensions :2.3.0

2.3.1

| 4
- 1 Chrome://Extensions
:2.3.2

2.3.2



Enabled .Enabled

2.4

. CSS
Style JavaScript JS.


Manifest.json
JSON


.
| 5
Manifest.json :

2.4.1

- :CSS CSS
( popup.html).

- :Images .

- :JS .

- :Popup.html
( .)Browser Action

- :Manifest.json
2.4.2
:Manifiest.json

2.4.2 Manifest.json

| 6
:

:manifest_version - .

:Name -
.

:Version - "
" Software Versioning .

:Description -
.

:Icons -
.

:Author - .

:browser_action - Browser Action





.

Manifest.json

Permissions

Physical Location GeoLocation !

| 7
2.5


:

.
- 2

- 1 :2.5.0

2.5.1

- 4 ( )Manifiest.json
Load Unpacked Extension
( ).

2.5.2

- 3
Reload
2.5.2 .

| 8
.3

3.1 API


! API
Application Programming Interface

.






!
.



.

.

3.2
Manifest.json
!

| 9


GeoLocation Manifest.json :

3.2.1 GeoLocation Manifest.json

Permissions Manifest.json
.

3.2.2

| 11
GeoLocation :Manifest.json


:GeoLocation

3.2.3 GeoLocation

3.3 :Synchronized Storage Local Storage




!

Manifest.json :

3.3.1 Storage

| 11

API :

:Local Storage -

3.3.2

chrome.storage.local Object
" "First Value To Save " "value
.

3.3.3

Value
:

3.3.4

| 12
:Synchronized Storage -

chrome.storage.local
chrome.storage.sync



...


!

!
:

3.3.5

chrome.storage.sync
.
chrome.storage.sync chrome.storage.local
!

!

012,411
8,092 502
.

| 13
4.3 Content Script Background Script
"
" !


! Script Background
.

background.js

... Manfiest.js
:3.4.0

3.4.1


background
js background.js persistent true

| 14

!
persistent true

!

false

!

background.js :

3.4.2


...
:

3.4.3

| 15
! background page
:

3.4.4

Facebook Mention Tagging Blocker



! Content Script
.

js content_script.js

! Manifest.json :Background Scripts

3.4.5

| 16
! :

- Content Scripts
! matches
.


js -

content_script.js js
!

- run_at
document_start
document_end .

- CSS !
CSS js CSS .CSS

content_script.js

3.4.6 content_script.js

3.4.7

| 17
! F12
.

Content Script Background Scripts


! Content
Script
Content Script Background Scripts
! Background Script Content Script
!

3.5 Message Passing

Message Passing
.
Background Script Content Script
.

content_script.js :background.js

3.5.1 content_script.js background.js

Content Script
chrome.runtime.sendMessage ()
background.js
background.js .

| 18
background.js 3.5.2:

3.5.2 background.js
content_script.js

chrome.runtime.onMessage.addListener
Content Script .background.js

greeting " I got


!"this, goodbye :

content_script.js
background.js "I got this, goodbye" :

3.5.3 background.js content_script.js

F12
background.js! Content Script Background
Script Content Script .

Simple One-Time Requests


!
Background Script Content Script
Long Live Connection .

!
. .

| 19
3.6 Badges

Browser Action
.

4
" "023
:3.6.0

3.6.1

Content Script
Content Script
Background Script :

3.6.2 background.js

chrome.browserAction

Badge ! Browser Action

Content Script
Background Script Content Script Message
.Passing

| 21
3.7



.
Notification
.

3.7.1



!
3 : .
.


:Manifest.json

3.7.2 Manifest.json

| 21

Content Script Background Script
Content Script Content Script Message
Passing .

background.js
:

3.7.3 background.js

Object (
Basic ) .


chrome.notifications.create
.


!
... !

| 22
.4



!

4.1 Chrome Web Store

2101
.

4.1.1

| 23
4.2.2

4.2


ZIP
.

CRX
ZIP
CRX
.


:
Manifest.json Load
Unpacked Extension .

| 24
CRX
:Pack Extension

4.2.1

CRX
:

4.2.2

Private Key
Pack Extension
:PEM

4.2.3

| 25
Ext.crx


.

Ext.crx :

4.2.4 CRX


:
( )
Add extension .

PEM


CRX PEM
CRX
CRX
CRX ID
.



!

.CRX

| 26
4.3

2104 33

()!
.

- .


. - Enterprise Policy

CRX
ZIP
.




24 .

| 27
4.4


5
. 4.4.0
:


4.4.1


4.4.2

| 28
:

- .Add new item

- 21


!

-

Dev. Mohammad M. AlBanna
:



4.4.3

-

Testers Accounts .

| 29
4.5 /

Add New Item


/ :

4.5.1

CRX
ZIP Choose File
:Upload

4.502

| 31
!
Manifest.json .

4.5.3

-

4.5.4 .Add a new site

4.5.4 Google Photos photos.google.com

| 31
Add a new site Google Webmasters Tools

!
.head

Refresh List
.




. Google
Webmasters Tools .

- :

4.5.5

Change Pricing :

4.5.6 ( )

| 32
!
.
.

-
:


4.5.7

-



!

4.5.8

| 33

Inline Install
:

4.5.9 Inline Install

- Google Analytics

ID :Google Analytics

4.5.11 Google Analytics

Google Analytics UA-


.

-

:

4.5.11

| 34
:Public .

:Unlisted .

:Private
.

- :

4.5.12

:Publish Changes
.

:Preview Changes
.

:Save draft and return to dashboard


.

:Discard draft .


4.6

%91
!
:

- 2 :


Obfuscated


.

| 35
:

4.6.1

!

.
.

| 36
:Minimized -1

4.6.2 jQuery

jQuery Minimized jQuery


! jQuery :
Minimized
Bandwidth
.


jQuery
... .


!
CRX
.

API : -2


"
"

.
.

| 37
: -3



.

.
.

/

!
.



( )
.

4.6.3

| 38

4.6.4

ID
( )
.

| 39
ID :


4.6.5

ID
:


4.6.6

| 41


:



4.6.7


CRX . Submit
.
...

| 41
.5

4 :


5.1


:Freemium -
.
.

:One-time Payment - .

:Subscription - .

:Custom -
.

| 42

:

Change Pricing :

| 43
5.1
/


Chrome

: Web Store

5.1.1

| 44
:

5.1.2




... .


%5

.

| 45

:

5.1.3


.

!
.


.
! .

| 46
5.2 In-App Payments

In-App Payments



.

:In-App Purchases

- :In-app Products

5.2.1

- Add new product .

| 47
- :

5.2.2

( ).

" " Offers in-app purchases :

5.2.3

| 48
5.3 Google AdSense


Google AdSense ...


Google AdSense
!
!

5.4.1


.
.

5.3

| 49

| 51

You might also like