网页开发中怎么判断是不是微信浏览器

2023-09-03 09:30:00 by wst

公众号开发

出发点

打算做一个网页,需要在以下类型浏览器中打开:

1. 微信浏览器(微信客户端)

2. 手机浏览器

3. 电脑浏览器

问题

1. 适配问题,电脑的屏幕较大,肯定和手机上显示的不一样。

2. 有些功能在微信浏览器可以用,在电脑浏览器上用不了。

解决方案

问题1:

解决方案有很多,这里采用的是bootstrap-vue来适配多端界面的。

问题2:

进入页面的时候,判断是否为微信浏览器,然后进行适配。

有老铁会问,怎么判断呢?往下看,

function isWeChat() {
    //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
    var ua = window.navigator.userAgent.toLowerCase();
    //通过正则表达式匹配ua中是否含有MicroMessenger字符串
    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
        return true;
    } else {
        return false;
    }
}

还有一个更简便的写法:

function isWechat() {
    return /MicroMessenger/i.test(window.navigator.userAgent);
}

这些在公众号开发中只是冰山一角,内容还多着呢。

参考链接如下:

1. 微信JS-SDK调用方法:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html

2. 网页授权登录:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html

3. 微信公众号支付:https://blog.51cto.com/u_15765713/5673693

 

在开发过程中如遇问题,欢迎讨论。wx:wst_ccut, 备注:微信开发。

 

一个专注微信生态开发的人。


Comments(132) Add Your Comment

Zxmctf
atorvastatin 40mg canada <a href="https://lipiws.top/">buy generic lipitor over the counter</a> atorvastatin 20mg tablet
Abfgcu
order baycip for sale - <a href="https://cipropro.top/">ciprofloxacin 500mg cost</a> cost augmentin 375mg
Exbqcs
cipro brand - <a href="https://metroagyl.top/keflexcapsule/">order generic keflex 500mg</a> clavulanate sale
Deuzxk
ciplox 500 mg price - <a href="https://septrim.top/doryx/">order doxycycline pills</a> buy erythromycin
Xuglfy
buy flagyl online cheap - <a href="https://metroagyl.top/">metronidazole order online</a> order zithromax 250mg sale
Xcxnrb
ivermectin 12 mg without prescription - <a href="https://keflexin.top/">ciplox over the counter</a> order tetracycline generic
Kusnkb
buy valacyclovir 500mg generic - <a href="https://gnantiviralp.com/starlix/">order starlix generic</a> acyclovir sale
Leaifw
buy ampicillin pills for sale <a href="https://ampiacil.top/">acillin ca</a> amoxil canada
Ucijvj
flagyl uk - <a href="https://metroagyl.top/azithromycin/">order zithromax pills</a> azithromycin 500mg cost
Ysmakq
lasix order online - <a href="https://antipathogenc.com/atacand/">atacand 8mg without prescription</a> buy captopril for sale
Bokkrr
glycomet usa - <a href="https://gnantiacidity.com/">glucophage tablet</a> purchase lincocin online cheap
Icefzs
order generic zidovudine 300 mg - <a href="https://canadiangnp.com/allopurinol/">zyloprim cost</a> allopurinol 100mg uk
Clihqv
purchase clozaril sale - <a href="https://genonlinep.com/altace/">buy generic tritace over the counter</a> buy generic famotidine 40mg
Qpzciq
buy quetiapine 50mg online - <a href="https://gnkantdepres.com/zoloft/">zoloft tablet</a> eskalith usa
Kchutc
buy anafranil 25mg generic - <a href="https://antdeponline.com/abilify/">aripiprazole 20mg canada</a> buy doxepin paypal
Qafrlj
atarax 10mg without prescription - <a href="https://antdepls.com/pamelor/">pamelor pills</a> endep 25mg generic
Gijrjr
buy clavulanate pills - <a href="https://atbioinfo.com/ethambutol/">ethambutol for sale</a> ciprofloxacin drug
Damjnb
purchase amoxil - <a href="https://atbioxotc.com/erythromycin/">erythromycin 500mg price</a> buy ciprofloxacin 1000mg online cheap
Vqnosh
zithromax buy online - <a href="https://gncatbp.com/btetracycline/">buy generic tetracycline over the counter</a> order ciprofloxacin sale
Qpvjyp
clindamycin canada - <a href="https://cadbiot.com/cefpodoxime/">buy generic vantin</a> chloramphenicol uk
Glgywt
stromectol where to buy - <a href="https://antibpl.com/">ivermectin 6mg without prescription</a> order cefaclor 250mg online cheap
Nihsfz
ventolin inhalator cheap - <a href="https://antxallergic.com/xsseroflo/">order seroflo inhalator online cheap</a> order theophylline pills
Eysddb
medrol 8 mg pills - <a href="https://ntallegpl.com/getcetirizine/">purchase zyrtec online cheap</a> azelastine 10ml us
Vgrvbp
clarinex brand - <a href="https://rxtallerg.com/getaristocort/">cheap aristocort 4mg</a> albuterol 4mg oral
Schmtf
buy micronase no prescription - <a href="https://prodeprpl.com/dapagliflozin5/">how to buy forxiga</a> cheap forxiga 10mg
Drpchu
metformin 1000mg usa - <a href="https://arxdepress.com/losartan25/">hyzaar pills</a> order acarbose 50mg online
Mihtoz
order repaglinide for sale - <a href="https://depressinfo.com/jardiance25/">empagliflozin pills</a> buy jardiance 25mg pills
Wdkcts
order lamisil for sale - <a href="https://treatfungusx.com/fulvicin250mg/">order griseofulvin 250 mg generic</a> griseofulvin canada
Xznniw
semaglutide drug - <a href="https://infodeppl.com/">rybelsus for sale online</a> desmopressin online order
Xeajis
order nizoral 200 mg - <a href="https://antifungusrp.com/clotrithasone/">order lotrisone sale</a> itraconazole 100 mg ca
Pjkiln
famciclovir 250mg us - <a href="https://amvinherpes.com/acyclovircream/">buy acyclovir 800mg</a> buy valcivir online
Ukdavg
purchase lanoxin generic - <a href="https://blpressureok.com/dipyridamole100/">how to get dipyridamole without a prescription</a> order lasix sale
Upinut
oral lopressor - <a href="https://bloodpresspl.com/propranolol/">propranolol uk</a> nifedipine 30mg generic
Eqhegk
cost hydrochlorothiazide 25 mg - <a href="https://norvapril.com/amlodipine/">amlodipine 10mg price</a> bisoprolol drug
Mmoasv
purchase nitroglycerin - <a href="https://nitroproxl.com/">buy nitroglycerin generic</a> diovan where to buy
Nmebuc
rosuvastatin goodness - <a href="https://antcholesterol.com/pravastatin/">pravastatin sock</a> caduet buy focus
Ynguug
zocor pretend - <a href="https://canescholest.com/gemfibrozil/">gemfibrozil key</a> lipitor lodge
Zwldfm
buy viagra professional explosion - <a href="https://edsildps.com/levitraoraljelly/">levitra oral jelly lend</a> levitra oral jelly online filch
Yubsuw
dapoxetine want - <a href="https://promedprili.com/fildena/">fildena fireplace</a> cialis with dapoxetine arise
Gmgbcm
cenforce seem - <a href="https://xcenforcem.com/brandviagrasildenafil/">brand viagra online ancient</a> brand viagra online foe
Fgmmsq
brand cialis bleed - <a href="https://probrandtad.com/brandlevitra/">brand levitra hoarse</a> penisole christmas
Dakeio
cialis soft tabs online eight - <a href="https://supervalip.com/levitrasoft/">levitra soft online happy</a> viagra oral jelly online steal
Ubmkus
brand cialis fifth - <a href="https://probrandtad.com/brandlevitra/">brand levitra triumph</a> penisole pour
Wxituz
cialis soft tabs online profession - <a href="https://supervalip.com/cialisoraljelly/">cialis oral jelly online supply</a> viagra oral jelly online miss
Zqndmx
cenforce online market - <a href="https://xcenforcem.com/">cenforce online snatch</a> brand viagra two
Byvttj
priligy impressive - <a href="https://promedprili.com/cialiswithdapoxetine/">cialis with dapoxetine avoid</a> cialis with dapoxetine tea
Ajthzr
acne treatment neat - <a href="https://placnemedx.com/">acne medication swirl</a> acne medication once
Xnwrxa
asthma medication pile - <a href="https://bsasthmaps.com/">asthma treatment steel</a> inhalers for asthma wary
Pkeeyp
treatment for uti tempt - <a href="https://amenahealthp.com/">uti treatment alas</a> treatment for uti manage
Pltgah
prostatitis treatment flap - <a href="https://xprosttreat.com/">prostatitis pills least</a> prostatitis medications trip
Hgeszm
valacyclovir crew - <a href="https://gnantiviralp.com/">valtrex pills physician</a> valacyclovir himself
Oxzvrj
claritin pills dublin - <a href="https://clatadine.top/">loratadine triumph</a> claritin pills shoot
Nnqtst
dapoxetine float - <a href="https://prilixgn.top/">priligy glass</a> dapoxetine instinct
Fmjdkg
claritin definite - <a href="https://clatadine.top/">loratadine web</a> claritin pills process
Oibwee
ascorbic acid saturday - <a href="https://ascxacid.com/">ascorbic acid alter</a> ascorbic acid breathe
Cttdlv
promethazine feel - <a href="https://prohnrg.com/">promethazine mutter</a> promethazine temple
Buybwc
biaxin simple - <a href="https://gastropls.com/">clarithromycin pills pen</a> cytotec draw
Tvgdnk
fludrocortisone weary - <a href="https://gastroplusp.com/">fludrocortisone thieve</a> lansoprazole key
Wvsrxt
rabeprazole 20mg for sale - <a href="https://gastrointesl.com/">order rabeprazole sale</a> buy generic domperidone over the counter
Wwunag
buy bisacodyl 5mg pills - <a href="https://gastroinfop.com/">purchase bisacodyl sale</a> order liv52 20mg online cheap
Kcefdv
order hydroquinone online cheap - <a href="https://danaterone.shop/">hydroquinone creams</a> duphaston order online
Urvcwl
order bactrim for sale - <a href="https://tobmycin.com/">tobramycin 5mg oral</a> buy cheap generic tobra
Yfbvws
purchase fulvicin generic - <a href="https://fulviseoful.com/">buy griseofulvin generic</a> gemfibrozil 300 mg pills
Cfruul
buy forxiga pills - <a href="https://sineqpin.com/">order doxepin 75mg for sale</a> buy precose 25mg generic
Uuwbfk
order dramamine generic - <a href="https://bisacolax.com/">purchase dramamine generic</a> actonel online buy
Fjlbpl
order vasotec - <a href="https://xalanoprost.com/">where can i buy xalatan</a> latanoprost ca
Wbiyrz
buy etodolac generic - <a href="https://cilosetal.com/">order cilostazol online cheap</a> cilostazol 100mg drug
Uzlzej
piroxicam over the counter - <a href="https://feldexicam.com/">order piroxicam 20mg without prescription</a> buy generic exelon for sale
Bifrec
order piracetam 800mg sale - <a href="https://nootquin.com/efavirenz/">purchase sustiva</a> sinemet 10mg us
Imlxwy
purchase hydrea for sale - <a href="https://hydroydrinfo.com/methocarbamol/">robaxin online order</a> order methocarbamol 500mg online
Pzifnp
depakote 500mg without prescription - <a href="https://adepamox.com/acetazolamide/">diamox 250 mg brand</a> purchase topamax for sale
Jtborc
buy norpace pills for sale - <a href="https://anorpica.com/lamotrigine/">lamictal 200mg ca</a> buy chlorpromazine
Qiuawi
cheap cytoxan pill - <a href="https://cycloxalp.com/atomoxetine/">buy cheap strattera</a> buy trimetazidine tablets
Icgapd
spironolactone 100mg canada - <a href="https://aldantinep.com/phenytoin/">purchase dilantin sale</a> naltrexone 50 mg pill
Qehkib
cyclobenzaprine medication - <a href="https://abflequine.com/prasugrel/">order prasugrel online cheap</a> how to buy enalapril
Oslhho
ondansetron canada - <a href="https://azofarininfo.com/procyclidine/">buy generic kemadrin online</a> requip brand
Fhggmh
ascorbic acid 500 mg sale - <a href="https://mdacidinfo.com/">order ascorbic acid 500 mg online</a> buy cheap generic prochlorperazine
Vollgd
buy durex gel online cheap - <a href="https://xalaplinfo.com/">purchase durex gel sale</a> xalatan ca
Hhrscn
minoxidil price - <a href="https://mdacidinfo.com/dutasteride/">how to get dutas without a prescription</a> finpecia buy online
Lnevys
buy leflunomide 20mg for sale - <a href="https://infohealthybones.com/">leflunomide price</a> buy generic cartidin over the counter
Daesaq
buy verapamil 240mg generic - <a href="https://infoheartdisea.com/">verapamil 240mg uk</a> cheap tenoretic tablets
Cmikle
order tenormin 50mg for sale - <a href="https://heartmedinfox.com/sotalol/">sotalol over the counter</a> order coreg 25mg without prescription
Tbqfma
buy generic atorlip over the counter - <a href="https://infoxheartmed.com/">cheap atorvastatin</a> order nebivolol for sale
Zluhop
buy gasex paypal - <a href="https://herbalinfomez.com/ashwagandha/">buy generic ashwagandha over the counter</a> buy diabecon pills
Soxbba
lasuna buy online - <a href="https://infoherbalmz.com/diarex/">buy diarex pills for sale</a> himcolin cheap
Hqoamx
norfloxacin generic - <a href="https://gmenshth.com/">noroxin online buy</a> purchase confido sale
Tqtusq
finax pills - <a href="https://finmenura.com/kamagra/">kamagra 100mg uk</a> order uroxatral 10 mg generic
Nmplif
buy speman sale - <a href="https://spmensht.com/">speman pills</a> purchase finasteride generic
Fkcxto
terazosin tablet - <a href="https://hymenmax.com/dutasteride/">avodart oral</a> order dapoxetine online cheap
Aozpps
buy cheap generic trileptal - <a href="https://trileoxine.com/">oxcarbazepine 600mg canada</a> cheap levoxyl tablets
Zygzcr
cyclosporine order - <a href="https://asimusxate.com/gloperba/">buy colcrys pill</a> colcrys online
Fiqdfi
lactulose price - <a href="https://duphalinfo.com/">purchase lactulose online</a> buy betahistine 16mg for sale
Wdfgsj
deflazacort buy online - <a href="https://lazacort.com/brimonidine/">purchase alphagan for sale</a> brimonidine online
Nbalqk
besivance where to buy - <a href="https://besifxcist.com/">besivance drug</a> purchase sildamax online
Mjbrro
buy generic gabapentin 100mg - <a href="https://aneutrin.com/">buy gabapentin 800mg pills</a> order azulfidine generic
Jtxnci
buy benemid 500 mg sale - <a href="https://bendoltol.com/">probenecid 500mg uk</a> tegretol for sale online
Vqkppa
colospa 135mg usa - <a href="https://coloxia.com/pletal/">generic cilostazol 100 mg</a> buy generic cilostazol for sale
Enxprg
buy celebrex 200mg generic - <a href="https://celespas.com/">celebrex 100mg ca</a> oral indomethacin 50mg
Loazbu
diclofenac online buy - <a href="https://dicloltarin.com/aspirin/">order aspirin generic</a> order aspirin 75mg pills
Yvvcvc
buy rumalaya without prescription - <a href="https://rumaxtol.com/shallaki/">shallaki pills</a> amitriptyline 10mg for sale
Xijvvs
mestinon order online - <a href="https://mestonsx.com/azathioprine/">buy imuran online cheap</a> imuran 50mg pill
Xpnzbb
voveran tablets - <a href="https://vovetosa.com/">purchase voveran without prescription</a> purchase nimotop online
Apqszs
baclofen canada - <a href="https://baclion.com/nspiroxicam/">piroxicam online buy</a> order generic piroxicam 20mg
Aumuyy
cost mobic 7.5mg - <a href="https://meloxiptan.com/rtrizatriptan/">toradol 10mg brand</a> buy toradol 10mg online cheap
Aotryf
periactin 4mg price - <a href="https://periheptadn.com/">periactin 4mg price</a> buy tizanidine online
Ophovw
trihexyphenidyl without prescription - <a href="https://voltapll.com/diclofenacgel/">buy emulgel</a> emulgel purchase online
Asartz
isotretinoin 10mg sale - <a href="https://aisotane.com/asdeltasone/">order deltasone 5mg pills</a> purchase deltasone generic
Misltn
where can i buy cefdinir - <a href="https://omnixcin.com/">buy omnicef 300mg online</a> purchase cleocin online
Dlaygl
prednisone 40mg generic - <a href="https://apreplson.com/prednisolone/">buy omnacortil 20mg online</a> buy zovirax cream
Tvqxaj
acticin oral - <a href="https://actizacs.com/tretinoin/">tretinoin online buy</a> buy generic tretinoin
Fibkvn
where can i buy flagyl - <a href="https://ametronles.com/">order generic metronidazole 400mg</a> buy cenforce generic
Uejsra
cost betnovate 20gm - <a href="https://betnoson.com/awdifferin/">purchase adapalene gel</a> cost monobenzone
Vdcslg
augmentin drug - <a href="https://alevonted.com/">cheap synthroid for sale</a> order levothroid online cheap
Vtvcre
where to buy clindamycin without a prescription - <a href="https://indometnp.com/">indocin order online</a> indomethacin 50mg capsule
Dazbxj
purchase cozaar pills - <a href="https://acephacrsa.com/">buy cephalexin 125mg for sale</a> purchase keflex
Ghiodu
purchase crotamiton online cheap - <a href="https://aeuracream.com/abactroban/">order mupirocin generic</a> cost aczone
Snrttg
order zyban sale - <a href="https://bupropsl.com/shuddhaguggulu/">buy shuddha guggulu sale</a> shuddha guggulu price
Chmenm
progesterone 200mg without prescription - <a href="https://apromid.com/clomiphene/">buy clomid 100mg for sale</a> cheap fertomid tablets
Vnkxzg
xeloda 500 mg sale - <a href="https://xelocap.com/">buy generic capecitabine 500 mg</a> danocrine 100mg without prescription
Ixumbx
order norethindrone 5 mg online - <a href="https://norethgep.com/yasmin/">yasmin pills</a> purchase yasmin pills
Issfkw
oral fosamax 70mg - <a href="https://pilaxmax.com/">fosamax canada</a> medroxyprogesterone for sale online
Uurhjf
cabergoline 0.25mg for sale - <a href="https://adostilin.com/">buy cabergoline pills</a> buy cheap generic alesse
Qwayvt
estrace 2mg over the counter - <a href="https://festrolp.com/">order estrace online cheap</a> buy arimidex online cheap
Guiknj
バイアグラ 副作用 - <a href="https://jpedpharm.com/tadalafil/">タダラフィルジェネリック 通販</a> タダラフィル 副作用
Byxdil
プレドニン おすすめ - <a href="https://jpaonlinep.com/">プレドニン通販おすすめ</a> アジスロマイシン は通販での購
Xxphhs
eriacta day - <a href="https://eriagra.com/dapcalisb/">apcalis delay</a> forzest amid
Svmnqz
プレドニン 市販 おすすめ - <a href="https://jpanfarap.com/jpadoxycycline/">ドキシサイクリン通販 安全</a> アキュテインの購入
Bdycbr
indinavir tablet - <a href="https://confindin.com/emulgel/">purchase voltaren gel</a> buy emulgel sale
Lcbivz
valif counsel - <a href="https://avaltiva.com/rtsinemet/">buy sinemet 10mg pill</a> where can i buy sinemet
Yzrsgw
provigil 100mg pills - <a href="https://provicef.com/lamivudine/">order lamivudine online cheap</a> order lamivudine sale
Mprykt
ivermectin buy online - <a href="https://ivercand.com/carbamazepine/">tegretol 400mg without prescription</a> tegretol order
Ufgsll
buy generic promethazine online - <a href="https://prometacin.com/asciprofloxacin/">brand ciprofloxacin 500mg</a> order lincomycin 500mg generic