How to use brs method in wpt

Best JavaScript code snippet using wpt

brwsniff.js

Source:brwsniff.js Github

copy

Full Screen

1/*2 * jsBrwSniff v0.53 *4 * A browser sniffer library5 * http://jsbrwsniff.sf.net6 *7 * Released under the GNU LGPL license8 * Author: Pau Garcia i Quiles <paugq AT users DOT sourceforge DOT net>9 *10 */11function getBrowser(obj) {12 var b=new Array("unknown", "unknown", "unknown", "unknown");13 (isEmpty(obj) ? brs=navigator.userAgent.toLowerCase() : brs=obj);14 if (brs.search(/omniweb[\/\s]v?(\d+([\.-]\d)*)/) != -1) {15 // Omniweb16 b[0]="omniweb";17 b[1]=brs.match(/omniweb[\/\s]v?(\d+([\.-]\d)*)/)[1];18 (b[1] > 4.5 ? b[2]="khtml" : b[2]="omniweb");19 (brs.search(/omniweb[\/\s]((\d+([\.-]\d)*)-)?v(\d+([\.-]\d)*)/) == -1 ? b[3]=brs.match(/omniweb[\/\s](\d+([\.-]\d)*)/)[1] : b[3]=brs.match(/omniweb[\/\s]((\d+([\.-]\d)*)-)?v(\d+([\.-]\d)*)/)[4]);20 return b;21 } else if (brs.search(/opera[\/\s](\d+(\.?\d)*)/) != -1) {22 // Opera23 b[0]="opera";24 b[1]=brs.match(/opera[\/\s](\d+(\.?\d)*)/)[1];25 b[2]="opera";26 b[3]=b[1];27 return b;28 } else if (brs.search(/crazy\s?browser\s(\d+(\.?\d)*)/) != -1) {29 // Crazy Browser30 b[0]="crazy";31 b[1]=brs.match(/crazy\s?browser\s(\d+(\.?\d)*)/)[1];32 b[2]="msie";33 b[3]=getMSIEVersion();34 return b;35 } else if (brs.search(/myie2/) != -1) {36 // MyIE237 b[0]="myie2";38 b[2]="msie";39 b[3]=brs.match(/msie\s(\d+(\.?\d)*)/)[1];40 return b;41 } else if (brs.search(/netcaptor/) != -1) {42 // NetCaptor43 b[0]="netcaptor";44 b[1]=brs.match(/netcaptor\s(\d+(\.?\d)*)/)[1];45 b[2]="msie";46 b[3]=getMSIEVersion();47 return b;48 } else if (brs.search(/avant\sbrowser/) != -1) {49 // Avant Browser50 b[0]="avantbrowser";51 b[2]="msie";52 b[3]=getMSIEVersion();53 return b;54 } else if (brs.search(/msn\s(\d+(\.?\d)*)/) != -1) {55 // MSN Explorer56 b[0]="msn";57 b[1]=brs.match(/msn\s(\d+(\.?\d)*)/)[1];58 b[2]="msie";59 b[3]=getMSIEVersion();60 return b;61 } else if (brs.search(/msie\s(\d+(\.?\d)*)/) != -1) {62 // MS Internet Explorer63 b[0]="msie";64 b[1]=getMSIEVersion();65 b[2]="msie";66 b[3]=b[1];67 return b;68 } else if (brs.search(/powermarks\/(\d+(\.?\d)*)/) != -1) {69 // PowerMarks70 b[0]="powermarks";71 b[1]=brs.match(/powermarks\/(\d+(\.?\d)*)/)[1];72 b[2]="msie";73 try {74 b[3]=getMSIEVersion();75 } catch (e) { }76 return b;77} else if (brs.search(/konqueror[\/\s](\d+([\.-]\d)*)/) != -1) {78 // Konqueror79 b[0]="konqueror";80 b[1]=brs.match(/konqueror[\/\s](\d+([\.-]\d)*)/)[1];81 b[2]="khtml";82 return b;83 } else if (brs.search(/safari\/(\d)*/) != -1) {84 // Safari85 b[0]="safari";86 b[1]=brs.match(/safari\/(\d+(\.?\d*)*)/)[1];87 b[2]="khtml";88 b[3]=brs.match(/applewebkit\/(\d+(\.?\d*)*)/)[1];89 return b;90 } else if(brs.search(/zyborg/) != -1) {91 // Zyborg (SSD)92 b[0]="zyborg";93 b[1]=brs.match(/zyborg\/(\d+(\.?\d)*)/)[1];94 b[2]="robot";95 b[3]="-1"96 return b;97 } else if (brs.search(/netscape6[\/\s](\d+([\.-]\d)*)/) != -1) {98 // Netscape 6.x99 b[0]="netscape";100 b[1]=brs.match(/netscape6[\/\s](\d+([\.-]\d)*)/)[1];101 b[2]="gecko";102 b[3]=getGeckoVersion();103 return b;104 } else if (brs.search(/netscape\/(7\.\d*)/) != -1) {105 // Netscape 7.x106 b[0]="netscape";107 b[1]=brs.match(/netscape\/(7\.\d*)/)[1];108 b[2]="gecko";109 b[3]=getGeckoVersion();110 return b;111 } else if (brs.search(/galeon[\/\s](\d+([\.-]\d)*)/) != -1) {112 // Galeon113 b[0]="galeon";114 b[1]=brs.match(/galeon[\/\s](\d+([\.-]\d)*)/)[1];115 b[2]="gecko";116 b[3]=getGeckoVersion();117 return b;118 } else if (brs.search(/nautilus[\/\s](\d+([\.-]\d)*)/) != -1) {119 // Nautilus120 b[0]="nautilus";121 b[1]=brs.match(/nautilus[\/\s](\d+([\.-]\d)*)/)[1];122 b[2]="gecko";123 b[3]=getGeckoVersion();124 return b;125 } else if (brs.search(/firefox[\/\s](\d+([\.-]\d)*)/) != -1) {126 // Firefox127 b[0]="firefox";128 b[1]=brs.match(/firefox[\/\s](\d+([\.-]\d)*)/)[1];129 b[2]="gecko";130 b[3]=getGeckoVersion();131 return b;132 } else if (brs.search(/k-meleon[\/\s](\d+([\.-]\d)*)/) != -1) {133 // K-Meleon134 b[0]="kmeleon";135 b[1]=brs.match(/k-meleon[\/\s](\d+([\.-]\d)*)/)[1];136 b[2]="gecko";137 b[3]=getGeckoVersion();138 return b;139 } else if (brs.search(/firebird[\/\s](\d+([\.-]\d)*)/) != -1) {140 // Firebird141 b[0]="firebird";142 b[1]=brs.match(/firebird[\/\s](\d+([\.-]\d)*)/)[1];143 b[2]="gecko";144 b[3]=getGeckoVersion();145 return b;146 } else if (brs.search(/phoenix[\/\s](\d+([\.-]\d)*)/) != -1) {147 // Phoenix148 b[0]="phoenix";149 b[1]=brs.match(/phoenix[\/\s](\d+([\.-]\d)*)/)[1];150 b[2]="gecko";151 b[3]=getGeckoVersion();152 return b;153 } else if (brs.search(/camino[\/\s](\d+([\.-]\d)*)/) != -1) {154 // Camino155 b[0]="camino";156 b[1]=brs.match(/camino[\/\s](\d+([\.-]\d)*)/)[1];157 b[2]="gecko";158 b[3]=getGeckoVersion();159 return b;160 } else if (brs.search(/epiphany[\/\s](\d+([\.-]\d)*)/) != -1) {161 // Epiphany162 b[0]="epiphany";163 b[1]=brs.match(/epiphany[\/\s](\d+([\.-]\d)*)/)[1];164 b[2]="gecko";165 b[3]=getGeckoVersion();166 return b;167 } else if (brs.search(/chimera[\/\s](\d+([\.-]\d)*)/) != -1) {168 // Chimera169 b[0]="chimera";170 b[1]=brs.match(/chimera[\/\s](\d+([\.-]\d)*)/)[1];171 b[2]="gecko";172 b[3]=getGeckoVersion();173 return b;174 } else if (brs.search(/icab[\s\/]?(\d+(\.?\d)*)/) !=-1) {175 // iCab176 b[0]="icab";177 b[1]=brs.match(/icab[\s\/]?(\d+(\.?\d)*)/)[1];178 b[2]="icab";179 b[3]=b[1];180 return b;181 } else if (brs.search(/netfront\/(\d+([\._]\d)*)/) != -1) {182 // NetFront183 b[0]="netfront";184 b[1]=brs.match(/netfront\/(\d+([\._]\d)*)/)[1];185 b[2]="netfront";186 b[3]=b[1];187 return b;188 } else if (brs.search(/netscape4\/(\d+([\.-]\d)*)/) != -1) {189 // Netscape 4.x190 b[0]="netscape";191 b[1]=brs.match(/netscape4\/(\d+([\.-]\d)*)/)[1];192 b[2]="mozold";193 b[3]=b[1];194 return b;195 } else if ( (brs.search(/mozilla\/(4.\d*)/) != -1) && (brs.search(/msie\s(\d+(\.?\d)*)/) == -1) ) {196 b[0]="netscape";197 b[1]=brs.match(/mozilla\/(4.\d*)/)[1];198 b[2]="mozold";199 b[3]=b[1];200 return b;201 } else if ((brs.search(/mozilla\/5.0/) != -1) && (brs.search(/gecko\//) != -1)) {202 // Mozilla Seamonkey203 b[0]="mozsea";204 b[1]=brs.match(/rv\x3a(\d+(\.?\d)*)/)[1];205 b[2]="gecko";206 b[3]=getGeckoVersion();207 return b;208 } else if (brs.search(/elinks/) != -1) {209 // ELinks210 b[0]="elinks";211 (brs.search(/elinks\/(\d+(\.?\d)*)/) == -1 ?212b[1]=brs.match(/elinks\s\x28(\d+(\.?\d)*)/)[1] :213b[1]=brs.match(/elinks\/(\d+(\.?\d)*)/)[1]);214 b[2]="elinks";215 b[3]=b[1];216 return b;217 } else if (brs.search(/w3m\/(\d+(\.?\d)*)/) != -1) {218 // w3m219 b[0]="w3m"220 b[1]=brs.match(/(^w3m|\sw3m)\/(\d+(\.?\d)*)/)[2];221 b[2]="w3m";222 b[3]=b[1];223 return b;224 } else if (brs.search(/links/) != -1) {225 // Links226 b[0]="links";227 (brs.search(/links\/(\d+(\.?\d)*)/) == -1 ? b[1]=brs.match(/links\s\x28(\d+(\.?\d)*)/)[1] : b[1]=brs.match(/links\/(\d+(\.?\d)*)/)[1]);228 b[2]="links";229 b[3]=b[1];230 return b;231 } else if (brs.search(/java[\/\s]?(\d+([\._]\d)*)/) != -1) {232 // Java (as web-browser)233 b[0]="java";234 b[1]=brs.match(/java[\/\s]?(\d+([\._]\d)*)/)[1];235 b[2]="java";236 b[3]=b[1];237 return b;238 } else if(brs.search(/lynx/) != -1) {239 // Lynx (SSD)240 b[0]="lynx";241 b[1]=brs.match(/lynx\/(\d+(\.?\d)*)/)[1];242 b[2]="libwww-fm";243 b[3]=brs.match(/libwww-fm\/(\d+(\.?\d)*)/)[1];244 return b;245 } else if(brs.search(/dillo/) != -1) {246 // Dillo (SSD)247 b[0]="dillo";248 b[1]=brs.match(/dillo\s*\/*(\d+(\.?\d)*)/)[1];249 b[2]="dillo";250 b[3]=b[1];251 return b;252 } else if(brs.search(/wget/) != -1) {253 // wget (SSD)254 b[0]="wget";255 b[1]=brs.match(/wget\/(\d+(\.?\d)*)/)[1];256 b[2]="robot";257 b[3]="-1"258 return b;259 } else if(brs.search(/googlebot\-image/) != -1) {260 // GoogleBot-Image (SSD)261 b[0]="googlebotimg";262 b[1]=brs.match(/googlebot\-image\/(\d+(\.?\d)*)/)[1];263 b[2]="robot";264 b[3]="-1"265 return b;266 } else if(brs.search(/googlebot/) != -1) {267 // GoogleBot (SSD)268 b[0]="googlebot";269 b[1]=brs.match(/googlebot\/(\d+(\.?\d)*)/)[1];270 b[2]="robot";271 b[3]="-1"272 return b;273 } else if(brs.search(/msnbot/) != -1) {274 // MSNBot (SSD)275 b[0]="msnbot";276 b[1]=brs.match(/msnbot\/(\d+(\.?\d)*)/)[1];277 b[2]="robot";278 b[3]="-1"279 return b;280 } else if(brs.search(/turnitinbot/) != -1) {281 // Turnitin (SSD)282 b[0]="turnitinbot";283 b[1]=brs.match(/turnitinbot\/(\d+(\.?\d)*)/)[1];284 b[2]="robot";285 b[3]="-1"286 return b;287 } else {288 b[0]="unknown";289 return b;290 }291}292// Return browser's (actual) major version or -1 if bad version entered293function getMajorVersion(v) {294 return (isEmpty(v) ? -1 : (hasDot(v) ? v : v.match(/(\d*)(\.\d*)*/)[1]))295}296// Return browser's (actual) minor version or -1 if bad version entered297function getMinorVersion(v) {298 return (!isEmpty(v) ? (!hasDot(v) ? v.match(/\.(\d*([-\.]\d*)*)/)[1] : 0) :299-1)300}301// Return operating system we are running on top of302function getOS(obj) {303 var os=new Array("unknown", "unknown");304 (isEmpty(obj) ? brs=navigator.userAgent.toLowerCase() : brs=obj);305 if (brs.search(/windows\sce/) != -1) {306 os[0]="wince";307 try {308 os[1]=brs.match(/windows\sce\/(\d+(\.?\d)*)/)[1];309 } catch (e) { }310 return os;311 } else if ( (brs.search(/windows/) !=-1) || ((brs.search(/win9\d{1}/) !=-1))312) {313 os[0]="win";314 if (brs.search(/nt\s5\.1/) != -1) {315 os[1]="xp";316 } else if (brs.search(/nt\s5\.0/) != -1) {317 os[1]="2000";318 } else if ( (brs.search(/win98/) != -1) || (brs.search(/windows\s98/)!=319-1 ) ) {320 os[1]="98";321 } else if (brs.search(/windows\sme/) != -1) {322 os[1]="me";323 } else if (brs.search(/nt\s5\.2/) != -1) {324 os[1]="win2k3";325 } else if ( (brs.search(/windows\s95/) != -1) || (brs.search(/win95/)!=326-1 ) ) {327 os[1]="95";328 } else if ( (brs.search(/nt\s4\.0/) != -1) || (brs.search(/nt4\.0/) ) !=329-1) {330 os[1]="nt4";331 }332 return os;333 } else if (brs.search(/linux/) !=-1) {334 os[0]="linux";335 try {336 os[1] = brs.match(/linux\s?(\d+(\.?\d)*)/)[1];337 } catch (e) { }338 return os;339 } else if (brs.search(/mac\sos\sx/) !=-1) {340 os[0]="macosx";341 return os;342 } else if (brs.search(/freebsd/) !=-1) {343 os[0]="freebsd";344 try {345 os[1] = brs.match(/freebsd\s(\d(\.\d)*)*/)[1];346 } catch (e) { }347 return os;348 } else if (brs.search(/sunos/) !=-1) {349 os[0]="sunos";350 try {351 os[1]=brs.match(/sunos\s(\d(\.\d)*)*/)[1];352 } catch (e) { }353 return os;354 } else if (brs.search(/irix/) !=-1) {355 os[0]="irix";356 try {357 os[1]=brs.match(/irix\s(\d(\.\d)*)*/)[1];358 } catch (e) { }359 return os;360 } else if (brs.search(/openbsd/) !=-1) {361 os[0]="openbsd";362 try {363 os[1] = brs.match(/openbsd\s(\d(\.\d)*)*/)[1];364 } catch (e) { }365 return os;366 } else if ( (brs.search(/macintosh/) !=-1) || (brs.search(/mac\x5fpowerpc/)367!= -1) ) {368 os[0]="macclassic";369 return os;370 } else if (brs.search(/os\/2/) !=-1) {371 os[0]="os2";372 try {373 os[1]=brs.match(/warp\s((\d(\.\d)*)*)/)[1];374 } catch (e) { }375 return os;376 } else if (brs.search(/openvms/) !=-1) {377 os[0]="openvms";378 try {379 os[1]=brs.match(/openvms\sv((\d(\.\d)*)*)/)[1];380 } catch (e) { }381 return os;382 } else if ( (brs.search(/amigaos/) !=-1) || (brs.search(/amiga/) != -1) ) {383 os[0]="amigaos";384 try {385 os[1]=brs.match(/amigaos\s?(\d(\.\d)*)*/)[1];386 } catch (e) { }387 return os;388 } else if (brs.search(/hurd/) !=-1) {389 os[0]="hurd";390 return os;391 } else if (brs.search(/hp\-ux/) != -1) {392 os[0]="hpux";393 try {394 os[1]=brs.match(/hp\-ux\sb\.[\/\s]?(\d+([\._]\d)*)/)[1];395 } catch (e) { }396 return os;397 } else if ( (brs.search(/unix/) !=-1) || (brs.search(/x11/) != -1 ) ) {398 os[0]="unix";399 return os;400 } else if (brs.search(/cygwin/) !=-1) {401 os[0]="cygwin";402 return os;403 } else if (brs.search(/java[\/\s]?(\d+([\._]\d)*)/) != -1) {404 os[0]="java";405 try {406 os[1]=brs.match(/java[\/\s]?(\d+([\._]\d)*)/)[1];407 } catch (e) { }408 return os;409 } else if (brs.search(/palmos/) != -1) {410 os[0]="palmos";411 return os;412 } else if (brs.search(/symbian\s?os\/(\d+([\._]\d)*)/) != -1) {413 os[0]="symbian";414 try {415 os[1]=brs.match(/symbian\s?os\/(\d+([\._]\d)*)/)[1];416 } catch (e) { }417 return os;418 } else {419 os[0]="unknown";420 return os;421 }422}423// Return Gecko version424function getGeckoVersion() {425 return brs.match(/gecko\/([0-9]+)/)[1];426}427// Return MSIE version428function getMSIEVersion() {429 return brs.match(/msie\s(\d+(\.?\d)*)/)[1];430}431// Return full browser UA string432function getFullUAString(obj) {433 (isEmpty(obj) ? brs=navigator.userAgent.toLowerCase() : brs=obj);434 return brs;435}436// Is Flash plug-in installed?437function hasFlashPlugin(obj) {438 (isEmpty(obj) ? brs=navigator.userAgent.toLowerCase() : brs=obj);439 var f=new Array("0", "0");440 var brwEng=getBrowser(obj)[2];441 //if (getBrowser(obj)[2]!="msie") {442 if ( (brwEng=="gecko") || (brwEng="opera") || (brwEng="khtml") || (brwEng="mozold")) {443 // Non-IE Flash plug-in detection444 if (navigator.plugins && navigator.plugins.length) {445 x = navigator.plugins["Shockwave Flash"];446 if (x) {447 f[0] = 2;448 if (x.description) {449 y = x.description;450 f[1] = y.charAt(y.indexOf('.')-1);451 }452 } else {453 f[0] = 1;454 }455 if (navigator.plugins["Shockwave Flash 2.0"]) {456 f[0] = 2;457 f[0] = 2;458 }459 } else if (navigator.mimeTypes && navigator.mimeTypes.length) {460 x = navigator.mimeTypes['application/x-shockwave-flash'];461 if (x && x.enabledPlugin) {462 f[0] = 2;463 } else {464 f[0] = 1;465 }466 }467 return f;468 } else if (brwEng=="msie") {469 // IE flash detection.470 for(var i=7; i>0; i--) {471 try {472 var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);473 f[1] = i;474 break;475 //return;476 } catch(e) { }477 }478 if (f[1]>0) {479 f[0]=2480 } else {481 f[0]=1482 }483 return f;484 } else {485 f[0]=0;486 f[1]=0;487 return f;488 }489}490/* FOR INTERNAL USE ONLY. THIS FUNCTIONS ARE SUBJECT TO CHANGE, DON'T TRUST THEM */491// Is input empty?492function isEmpty(input) {493 return (input==null || input =="")494}495// Does this string contain a dot?496function hasDot(input) {497 return (input.search(/\./) == -1)498}...

Full Screen

Full Screen

breadcrumb.js

Source:breadcrumb.js Github

copy

Full Screen

1import mixin from '~/plugins/mixin'2class Breadcrumb {3 constructor () {4 this.breadcrumbs = []5 this.callbacks = []6 }7 generate (callbacks, name, params) {8 this.breadcrumbs = []9 this.callbacks = callbacks10 this.call(name, params)11 return this.breadcrumbs12 }13 call (name, params = {}) {14 if (!name) {15 return16 }17 if (typeof this.callbacks[name] === 'undefined') {18 throw new Error('Breadcrumb not found with name ' + name)19 }20 this.callbacks[name](this, params)21 }22 parent (name, params = {}) {23 if (!name) {24 return25 }26 this.call(name, params)27 }28 push (title, location, data = {}) {29 this.breadcrumbs.push(30 Object.assign(data, { title: title, location: location }))31 }32}33class BreadCrumbManager {34 constructor () {35 this.generator = new Breadcrumb()36 this.callbacks = []37 }38 register (name, callback) {39 if (!name) {40 return41 }42 if (typeof this.callbacks[name] !== 'undefined') {43 throw new Error('Breadcrumb name "' + name +44 '" has already been registered')45 }46 this.callbacks[name] = callback47 }48 generate (name, params) {49 if (!name) {50 return51 }52 return this.generator.generate(this.callbacks, name, params)53 }54}55// Init breadcrumbs routes.56const br = new BreadCrumbManager()57br.register('index', (brs) => {58 brs.push('Home', { name: 'index' })59})60br.register('blocks', (brs) => {61 brs.parent('index')62 brs.push('Blocks', { name: 'blocks' })63})64br.register('blocks-slug', (brs, location) => {65 brs.parent('blocks')66 brs.push('Block #' + location.params.slug, location)67})68br.register('accounts', (brs) => {69 brs.parent('index')70 brs.push('Accounts', { name: 'accounts' })71})72br.register('address-slug', (brs, location) => {73 brs.parent('accounts')74 let title = 'Address Detail'75 if (location instanceof Object) {76 title = location.params.slug77 }78 brs.push(title, location)79})80br.register('txs', (brs) => {81 brs.parent('index')82 const block = mixin.methods.getParameterByName('block')83 if (block) {84 brs.push('Blocks', { name: 'blocks' })85 brs.push(`Transaction for Block #${block}`, window.location.pathname + window.location.search)86 } else {87 brs.push('Transactions', { name: 'txs' })88 }89})90br.register('txs-slug', (brs, location) => {91 brs.parent('txs')92 brs.push('Transaction Detail', location)93})94br.register('tokens', (brs) => {95 brs.parent('index')96 brs.push('Tokens', { name: 'tokens' })97})98br.register('orders', (brs) => {99 brs.parent('index')100 brs.push('Orders', { name: 'orders' })101})102br.register('orders-slug', (brs, location) => {103 brs.parent('orders')104 brs.push('Orders Detail', location)105})106br.register('trades', (brs) => {107 brs.parent('index')108 brs.push('Trades History', { name: 'trades' })109})110br.register('trades-slug', (brs, location) => {111 brs.parent('trades')112 brs.push('Trade Detail', location)113})114br.register('tokens-slug', (brs, location) => {115 brs.parent('tokens')116 brs.push('Token Detail', location)117})118br.register('tokens-trc20', (brs, location) => {119 brs.parent('tokens')120 brs.push('TRC20 Token', location)121})122br.register('tokens-trc21', (brs, location) => {123 brs.parent('tokens')124 brs.push('TRC21 Token', location)125})126br.register('tokens-nft', (brs, location) => {127 brs.parent('tokens')128 brs.push('TRC721 Token', location)129})130br.register('tokens-slug-info', (brs, location) => {131 brs.parent('tokens')132 brs.push('Update Token Info', location)133})134br.register('tokentxs', (brs) => {135 brs.parent('index')136 brs.push('Token (TRC20) Transfers', { name: 'tokentxs' })137})138br.register('tokentxs-nft', (brs) => {139 brs.parent('index')140 brs.push('Token (TRC721) Transfers', { name: 'tokentxs-nft' })141})142br.register('tokentxs-trc21', (brs) => {143 brs.parent('index')144 brs.push('Token (TRC21) Transfers', { name: 'tokentxs-trc21' })145})146br.register('follows', (brs) => {147 brs.parent('index')148 brs.push('Follow List', { name: 'follows' })149})150br.register('contracts', (brs) => {151 brs.parent('index')152 brs.push('Contracts', { name: 'contracts' })153})154br.register('contracts-verify', (brs) => {155 brs.parent('contracts')156 brs.push('Contracts Verify', { name: 'contracts-verify' })157})158br.register('reset-password', (brs) => {159 brs.parent('index')160 brs.push('Reset Password', { name: 'accounts-reset-password' })161})162br.register('sign-txs', (brs) => {163 brs.parent('txs')164 brs.push('Sign Transactions', { name: 'txs-signTxs' })165})166br.register('other-txs', (brs) => {167 brs.parent('txs')168 brs.push('Normal Transactions', { name: 'txs-normalTxs' })169})170br.register('masternodes', (brs) => {171 brs.parent('accounts')172 brs.push('Masternodes', { name: 'masternodes' })173})174br.register('epochs', (brs) => {175 brs.parent('index')176 brs.push('Epochs', { name: 'epochs' })177})178br.register('download', (brs) => {179 brs.parent('index')180 brs.push('Download', { name: 'download' })181})182br.register('epochs-slug', (brs) => {183 brs.parent('epochs')184 brs.push('Epochs detail', { name: 'epochs-slug' })185})186br.register('lending-orders', (brs) => {187 brs.parent('index')188 brs.push('Lending Orders', { name: 'lending-orders' })189})190br.register('lending-orders-slug', (brs) => {191 brs.parent('lending-orders')192 brs.push('Lending Order Detail', { name: 'lending-orders-slug' })193})194br.register('lending-recalls', (brs) => {195 brs.parent('index')196 brs.push('Lending Recalls', { name: 'lending-recalls' })197})198br.register('lending-recalls-slug', (brs) => {199 brs.parent('lending-recalls')200 brs.push('Lending Recall Detail', { name: 'lending-recalls-slug' })201})202br.register('lending-trades', (brs) => {203 brs.parent('index')204 brs.push('Lending Trades', { name: 'lending-trades' })205})206br.register('lending-trades-slug', (brs) => {207 brs.parent('lending-trades')208 brs.push('Lending Trade Detail', { name: 'lending-trades-slug' })209})210br.register('lending-topup', (brs) => {211 brs.parent('index')212 brs.push('Lending Topup', { name: 'lending-topup' })213})214br.register('lending-topup-slug', (brs) => {215 brs.parent('lending-topup')216 brs.push('Lending Topup Detail', { name: 'lending-topup-slug' })217})218br.register('lending-repay', (brs) => {219 brs.parent('index')220 brs.push('Lending Repay', { name: 'lending-repay' })221})222br.register('lending-repay-slug', (brs) => {223 brs.parent('lending-repay')224 brs.push('Lending Repay Detail', { name: 'lending-repay-slug' })225})226br.register('relayers', (brs) => {227 brs.parent('index')228 brs.push('Relayers', { name: 'relayers' })229})230export const state = () => ({231 items: null232})233export const mutations = {234 setItems (state, payload) {235 state.items = br.generate(payload.name, payload.to)236 }237}238export const actions = {}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const wpt = require('webpagetest');2const fs = require('fs');3const path = require('path');4const util = require('util');5const exec = util.promisify(require('child_process').exec);6const { execSync } = require('child_process');7const { exit } = require('process');8const { Console } = require('console');9const { resolve } = require('path');10const wptClient = wpt('www.webpagetest.org', 'A.6c0a0a0f1c8e8a9a9e2c1c7d0d8a8a4a');11const location = 'ec2-eu-west-1:Chrome.Cable';12const runs = 1;13const firstViewOnly = false;14const private = true;15const connectivity = 'Cable';16const mobile = false;17const video = true;18const videoParams = {19};20const timeline = true;21const trace = true;

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var wpt = new WebPageTest('www.webpagetest.org');3var wpt = require('wpt');4var wpt = new WebPageTest('www.webpagetest.org');5 if (err) return console.error(err);6 console.log(data);7});8var wpt = require('wpt');9var wpt = new WebPageTest('www.webpagetest.org');10 if (err) return console.error(err);11 console.log(data);12});13var wpt = require('wpt');14var wpt = new WebPageTest('www.webpagetest.org');15 if (err) return console.error(err);16 console.log(data);17});18var wpt = require('wpt');19var wpt = new WebPageTest('www.webpagetest.org');20 if (err) return console.error(err);21 console.log(data);22});23var wpt = require('wpt');24var wpt = new WebPageTest('www.webpagetest.org');25 if (err) return console.error(err);26 console.log(data);27});28var wpt = require('wpt');29var wpt = new WebPageTest('www.webpagetest.org');30 if (err) return console.error(err);31 console.log(data);32});33var wpt = require('wpt');34var wpt = new WebPageTest('

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('brs').wpt;2var options = {3};4wpt.runTest(options, function(err, data) {5 if (err) return console.error(err);6 console.log(data);7});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var options = {key: 'A.1234567890abcdef1234567890abcdef12345678'};3var wptClient = new wpt('www.webpagetest.org', options);4var wptClient = new wpt('www.webpagetest.org', options);5 console.log(data);6});7{8 "dependencies": {9 }10}11{ [Error: connect ECONNREFUSED

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var brs = require('brs');3var options = {4 videoParams: {5 }6};7wpt.runTest(options, function(err, data) {8 if (err) return console.log(err);9 console.log(data);10 brs(data.data.median.firstView.SpeedIndex, function(err, data) {11 if (err) return console.log(err);12 console.log(data);13 });14});15var wpt = require('webpagetest');16var brs = require('brs');17var options = {18 videoParams: {19 }20};21wpt.runTest(options, function(err, data) {22 if (err) return console.log(err);23 console.log(data);24 brs(data.data.median.firstView.SpeedIndex, function(err, data) {25 if (err) return console.log(err);26 console.log(data);27 });28});29var wpt = require('webpagetest');30var brs = require('brs');31var options = {32 videoParams: {33 }34};35wpt.runTest(options, function(err,

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var options = {3};4var test = new wpt('www.webpagetest.org', options.key);5test.runTest(testUrl, options, function(err, data) {6 if (err) return console.error(err);7 console.log('Test status:', data.statusText);8 console.log('Test ID:', data.data.testId);9 console.log('Test URL:', data.data.summary);10 console.log('Test results:', data.data);11 console.log('Test results:', data.data.runs[1].firstView);12 console.log('Test results:', data.data.runs[1].firstView.SpeedIndex);13});14var wpt = require('webpagetest');15var options = {16};17var test = new wpt('www.webpagetest.org', options.key);18test.runTest(testUrl, options, function(err, data) {19 if (err) return console.error(err);20 console.log('Test status:', data.statusText);21 console.log('Test ID:', data.data.testId);22 console.log('Test URL:', data.data.summary);23 console.log('Test results:', data.data);24 console.log('Test results:', data.data.runs[1].firstView);25 console.log('Test results:', data.data.runs[1].firstView.SpeedIndex);26});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful