owned this note changed 6 years ago
Linked with GitHub

瀏覽器擴充套件工作坊(第三梯次) - Ett Chung

由於場地問題,第二天我們移動到另一棟大樓啦!議程教室變動請見網站上的議程表

歡迎來到 https://hackmd.io/@coscup/2019 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

投影片連結:https://goo.gl/hgoiVp
範例連結:goo.gl/M2DUsg (講者GitHub)

可參考第一梯次共筆

範例套件功能:加紅框

manifest.json
設定用
定義權限
蓋覽
content script
在使用者符合特頂網址時,要注入什麼Code
background scriptnd
伴隨瀏覽器執行的部分

切換Git範例可以看到Code演變

V2:
版本號更改
增加ICON
邊框變成綠色

V3
改名
增加設定頁(寫一個Html) option.js

網站是無法逆向知道使用者知道什麼套件的

https://addons.mozilla.org/zh-TW/firefox/addon/crxviewer/?src=search
可以看別人套件原始碼的外掛 (firefox)

一些開發工具:自動刷新套件到最新的工具

如何上傳?

壓縮成ZIP上傳 END 沒什麼特別
有工具可以協助上傳

上傳要收費 20套件5美金
FireFox 免費 (nice!!)

套件安全
先看權限
看API
看連線的網域

content_security_policy

ref: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy

"script-src 'self' https://example.com; object-src 'self'"
可執行來自任何網站的script,危險!

"script-src 'self' 'unsafe-eval'; object-src 'self';"
可執行eval字串的script (例如藏在圖片裡面的字串),危險!

tags: COSCUP2019 IB306
Select a repo