Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Tsim Cov Ntawv Teev Npe
- Kauj ruam 2: Tsim Manifest File thiab Code It
- Kauj Ruam 3: Tsim cov Icons thiab hloov kho Manifest
- Kauj ruam 4: Ntxiv Popup
- Nyob Zoo Ntiaj Teb
- Kauj Ruam 5: Ua Kom Nws Zoo Zoo thiab Ua Nws Sib Tham
- Nyob Zoo Ntiaj Teb
- Nyob Zoo Ntiaj Teb
- Kauj Ruam 6: Tshaj Tawm Nws rau Chrome Web Store
Video: Chrome Web Extension - Tsis Muaj Kev Paub Ua Ntej Yuav Xav Tau: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Chrome Extensions yog cov haujlwm me me uas tsim los txhim kho cov neeg siv tshawb nrhiav. Yog xav paub ntxiv txog chrome txuas ntxiv mus rau
Txhawm rau ua Chrome Web Extension, yuav tsum muaj coding, yog li nws muaj txiaj ntsig zoo los tshuaj xyuas HTML, JavaScript, thiab CSS ntawm lub vev xaib hauv qab no:
www.w3schools.com/default.asp (w3 cov tsev kawm ntawv yog lub vev xaib zoo rau cov peev txheej coding)
Tsis paub yuav ua li cas? Tsis txhob txhawj xeeb, qhov kev qhia no yuav pab coj txoj hauv kev.
Qhov zoo tshaj plaws ntawm Chrome txuas ntxiv yog tias lawv tuaj yeem kho tau. Nws tsis yog ib yam tshwj xeeb uas tuaj yeem ua tiav, yog li muaj tswv yim.
Khoom siv
Cov khoom siv uas xav tau yog hauv qab no:
- Lub khoos phis tawj nrog cov ntawv sau (Kuv siv Notepad)
- Google Chrome
Thiab tag nrho cov!
Kauj ruam 1: Tsim Cov Ntawv Teev Npe
Ua ntej, tsim daim nplaub tshev los tuav tag nrho cov ntaub ntawv, thiab npe nws 'txuas ntxiv'. Lub npe tuaj yeem hloov pauv tom qab yog xav tau.
Kauj ruam 2: Tsim Manifest File thiab Code It
Cov ntaub ntawv tshwm sim yog ib feem tseem ceeb heev ntawm kev txuas ntxiv. Nws qhia qhov txuas ntxiv raws nraim qhov yuav tsum ua thiab yog. Cov ntaub ntawv tshaj tawm tau muab tso rau hauv JSON. Thawj kauj ruam yog qhib cov ntawv sau thiab khaws cov ntaub ntawv tshiab li 'manifest.json'.
Tom ntej no ntaus cov ntawv hauv qab no:
{
"lub npe": "Thawj qhov txuas ntxiv", "version": "1.0", "kev piav qhia": "Kuv tuaj yeem sau tus lej txuas ntxiv", "manifest_version": 2, "browser_action": {"default_title": "Thawj qhov txuas ntxiv"}}
Nco qab tus lej tom qab tus nqi!
Tom qab qhov no tau ntaus, khaws cov ntaub ntawv tshwm sim thiab mus rau chrome: // txuas ntxiv (Chrome yuav tsum tau siv ua qhov browser rau qhov no). Ib zaug ntawm chrome: // txuas ntxiv, qhib hom tsim tawm. Tom qab ntawd, nyem lub pob 'Load unpacked' thiab xaiv 'nplaub tshev' txuas ntxiv.
drum roll thov …
Yay! Qhov ntawd yog qhov txuas ntxiv, tshwj tsis yog… nws zoo li tho txawv. Nws tsis ua dab tsi li tam sim no, tab sis tsis ntev nws yuav txias heev.
Kauj Ruam 3: Tsim cov Icons thiab hloov kho Manifest
Ib lub vev xaib uas ua haujlwm zoo rau kos duab yog https://www.piskelapp.com/. Muaj lwm qhov kev kos duab muaj rau siv, ib yam nkaus. Cov cim yuav tsum yog plaub fab. Txoj haujlwm no yuav siv 16x16, 32x32, 48x48, thiab 128x128 lub cim. Thaum lub cim tau tsim, ua daim nplaub tshev hu ua 'duab' hauv daim nplaub tshev txuas ntxiv thiab muab lub cim tso rau hauv daim nplaub tshev ntawd. Nws yuav yog lub tswv yim zoo rau npe lub duab raws li nws qhov loj me. Piv txwv li, 'icon32.png'. Txoj cai tshiab yog hauv qab no:
{
"lub npe": "Thawj qhov txuas ntxiv", "version": "1.0", "kev piav qhia": "Kuv tuaj yeem sau tus lej txuas ntxiv", "manifest_version": 2, "browser_action": {"default_title": "Thawj qhov txuas ntxiv", " default_icon ": {" 16 ":" images/icon16-p.webp
Rau kev siv ntawm tus lej pom, mus rau
Kauj ruam 4: Ntxiv Popup
Qhov txuas ntxiv no yuav muaj popup. Qhov tshwm sim yog HTML (Hypertext Markup Language) cov ntaub ntawv, yog li nws yog qhov zoo kom kawm paub pib ntawm HTML, CSS, thiab JavaScript ua ntej.
Ua ntej, khaws ib daim ntawv ua 'popup.html' cov ntawv hauv daim nplaub tshev txuas ntxiv.
Tom ntej no, kho cov ntaub ntawv qhia pom 'popup.html' thaum nws tau nyem. Txoj cai tshiab yog hauv qab no:
{
"lub npe": "Thawj qhov txuas ntxiv", "version": "1.0", "kev piav qhia": "Kuv tuaj yeem sau tus lej txuas ntxiv", "manifest_version": 2, "browser_action": {"default_title": "Thawj qhov txuas ntxiv", " default_icon ": {" 16 ":" images/icon16-p.webp
Tsis txhob hnov qab tus comma!
Tam sim no, yog tias cov lej HTML hauv qab no tau ntxiv rau popup.html, tom qab ntawd nws yuav qhia 'Nyob Zoo Ntiaj Teb' thaum nyem.
Nyob Zoo Ntiaj Teb
Kauj Ruam 5: Ua Kom Nws Zoo Zoo thiab Ua Nws Sib Tham
Yog tias kab HTML yooj yim tau ntaus, tom qab ntawd nws tau txais qhov tsawg kawg nkaus liab qab ua tiav. Yog tias CSS (Cascading Style Sheets) tau ntxiv, tom qab ntawd nws yuav zoo li txias dua, thiab yog tias JavaScript tau ntxiv, tom qab ntawd nws tuaj yeem sib tham tau ntau dua. Phau ntawv qhia no yuav tsis piav qhia ntxaws piav qhia HTML, JavaScript, thiab CSS, tab sis muaj ntau cov peev txheej hauv online. Hauv qab no yog cov cai rau qhov yooj yim 'Nyob Zoo Hauv Ntiaj Teb' txoj haujlwm, tom qab ntawd muaj cov xim zoo nkauj dua, raws li:
Nyob Zoo Ntiaj Teb
Nyob Zoo Ntiaj Teb
#nyob zoo {keeb kwm yav dhau xim: #000000; xim: #ff0000; ciam teb: 8px pib #86a3b2; ciam teb-vojvoog: 50px; hloov pauv: tig (57deg); duav: 10px; neeg siv-xaiv: tsis muaj; tus cursor: crosshair; kev hloov pauv: hloov 2s; } #hello: hover {hloov pauv: tig (-417deg); }
Qhov piv txwv thib ob no tuaj yeem ua rau tsis meej pem, rau tus pib. Tab sis, qhov no yog qhia koj li cas tseem ceeb CSS yog rau ib qho program/txuas ntxiv. Tam sim no yuav yog lub sijhawm zoo los so thiab kawm qee qhov HTML5 coding thiab siv developer.chrome.com rau qee qhov siv. Nws yuav siv qee lub sijhawm, tab sis tuaj yeem ua qhov txuas ntxiv tau zoo.
Kauj Ruam 6: Tshaj Tawm Nws rau Chrome Web Store
Yog tias qee leej tau ua qhov txuas ntxiv zoo tiag tiag thiab lawv xav qhia nws rau ntiaj teb, tom qab ntawd lawv tuaj yeem tshaj tawm nws. Ntawd yog, tom qab tag nrho, lub ntsiab lus ntawm kev txuas ntxiv. Phau ntawv qhia no tsuas yog sim piav qhia cov ntaub ntawv tshwm sim, thiab koj yuav siv nws li cas, thiab nws tsuas yog muaj 'Hello World' program.
Thawj qhov uas yuav tsum ua kom nthuav dav rau pej xeem yog ua cov ntawv tais ceev tseg rau hauv zip file. Qhov thib ob uas yuav tsum ua yog mus rau https://chrome.google.com/webstore/category/extensions thiab nkag mus rau hauv google account. Tom qab ntawd, nyem rau ntawm lub pob iav teeb tsa thiab tom qab ntawd nyem rau ntawm 'developer dashboard'. Nias lub pob 'Khoom Tshiab' txhawm rau rub cov ntawv zip. Thaum muaj, nws yog qhov yuav tsum tau hloov kho Cov Ntawv Teev Npe, Tsis pub twg paub, thiab tus nqi. Qhov txuas ntxiv tuaj yeem luam tawm tau yooj yim yog tias nws tau xa rau kev tshuaj xyuas.
Tam sim no qhov txuas ntxiv tau ua tiav, txuas ntxiv mus rau code!
Pom zoo:
Yuav Ua Li Cas Kom Tau Txais Kev Kuj/Capacitance Siv Cov Khoom Uas Koj Muaj Lawm!: 6 Cov Kauj Ruam
Yuav Ua Li Cas Ua Kom Muaj Kev Kuj/Muaj Peev Xwm Siv Cov Cheeb Tsam Koj Twb Muaj!: Qhov no tsis yog tsuas yog lwm qhov/sib npaug sib npaug tiv taus lub laij lej! Qhov kev pabcuam no suav yuav ua li cas ua ke cov resistors/capacitors uas koj tam sim no yuav tsum ua tiav lub hom phiaj tsis kam/lub peev xwm tus nqi uas koj xav tau.Koj puas tau xav tau tshwj xeeb
Yuav Ua Li Cas Thiaj Li Ua Ntej Ua Ntej Yooj Yim Software Siv Python: 6 Cov Kauj Ruam
Yuav Ua Li Cas Thiaj Li Yooj Yim Ua Ntej Ua Ntej Software Siv Python: Nyob zoo, zoo siab txais tos rau Cov Lus Qhia no. Ntawm no kuv yuav qhia yuav ua li cas thiaj ua rau koj tus kheej software. Yog tias koj muaj lub tswv yim … tab sis paub paub siv lossis xav tsim cov khoom tshiab tom qab ntawd nws yog rau koj …… Yam yuavtsum tau kawm uantej: Yuav tsum muaj kev paub pib ntawm P
Ua Kev Tshawb Fawb Saib Pem Hauv Ntej Panels rau Koj Txoj Haujlwm DIY Tom ntej: 7 Cov Kauj Ruam (nrog Duab)
Ua Tus Kws Tshaj Lij Saib Pem Hauv Ntej Panels rau Koj Qhov Project DIY Tom ntej: Ua cov kws tshaj lij saib pem hauv ntej rau DIY cov haujlwm tsis tas yuav nyuaj lossis kim. Nrog qee qhov software pub dawb, cov khoom siv hauv chaw ua haujlwm thiab sijhawm me ntsis koj tuaj yeem ua cov kws tshaj lij saib pem hauv ntej vaj huam sib luag hauv tsev kom nthuav tawm koj txoj haujlwm tom ntej
Yuav Ua Li Cas Ua Ntej Ua Ntej Ua Ntej: 8 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Ua Ntej Ua Ntej Ua Ntej Tsis Txaus Siab: BACKGROUND INFO: Kuv ib txwm ntxub lub suab nrov nrov ntawm txhua tus nas txij li thaum kuv tsis nyiam thab lwm tus neeg thaum kuv tab tom nyem rau hauv cov vis dis aus lossis yooj yim saib lub vev xaib. Vim li no, Kuv txiav txim siab hloov kho kuv thawj qhov kev ua si nas kom zoo rau
Yuav Ua Li Cas Ntxiv Cov Suab Ib puag ncig rau Chav Ua Ntej Ua Ntej: 5 Kauj Ruam
Yuav Ua Li Cas Ntxiv Cov Suab Ib puag ncig rau Chav Ua Ntej Ua Ntej: Koj puas xav ntxiv lub suab ib puag ncig rau hauv chav tab sis pom tias koj yuav tsum tau sib cais koj cov phab ntsa lossis ua qhov hauv qab nthab? Zoo ntawm no yog txoj hauv kev yooj yim me ntsis tso rau hauv cov xaim nrog tsis ua ib qho kev tsim kho loj, lossis ib qho hlo li