How to use logScript method in wpt

Best JavaScript code snippet using wpt

logScript.js

Source:logScript.js Github

copy

Full Screen

1/*2http://www.lightninglauncher.com/wiki/doku.php?id=script_customviewlog3About the script4Purpose : With this script you can create a log in a custom view which lets you log things. Any errors in your script will also be written to this log5Author : cdfa6Link : https://plus.google.com/100430440392224314007/posts/ht4aZS8LSWg7Version: 1.0.6.38How to use the script9If you're in the script repository app (you should be) click search and import and chose “logScript”. Tick the “Lightning Menu” box and make sure it says “logScript” on top. (this is very important!! If you really want to name it differently modify the script where is says “if (LL.getCurrentScript().getName() == “logScript”)” and replace logScript with the new name) 10Run this script in a container to set up the log view. If you want to use the log function and automatic error logging put exactly these two lines somewhere in the top of your script:11(copy/paste)12?13114//function log(){}try{return(function(){var logScript=getScriptByName('logScript');if(logScript){eval('function run(){'+logScript.getText()+'}');return run();}})();}catch(e){alert("At line "+e.lineNumber+": "+e);}//logScriptEnd15(before this gets executed you can't use the log function and errors won't get caught)16usage: log(text, logLevel, replacements..)17Loglevels are accessed through logScript.logLevel. If you need some number or something to be inside the the text you can enter “{}” where the text should be and it will get replaced by the extra argument you passed. So for example:18log(“This {} has id: {}”, logScript.logLevel.NORMAL, item.getType(), item.getId())19will write: This Shortcut had id: 18894.20please report any bugs/feature suggestion in the google plus post21Changelog221.0.123Fixed a small bug with linenumbers241.0.225Fixed a bug that occured when a script causes the container to reload, because of which logs before then wouldn't be saved and displayed after the reload.261.0.327fixed slow writing speed which caused duplicates and wrong order of logs281.0.429There is now a clear log button, so you don't have to delete it wherever you are saving it30You can now reduce your whole script to one line without the line that starts this script breaking your script311.0.532The logs are now saved on pause of the custom view instead of after the script has finished running. (But for some reason the paused event doesn't get fired when you restart the app, so keep that in mind)33you can now pass replacements to the log function (see above)34Some Errors in the logscript won't cause your script to break anymore.35Be sure to update the line that enables logscript.361.0.5.137Small fix for the log getting too big.38You can now run the script from an item to create a custom view with the same dimensions as the item.391.0.640Your code isn't executed in eval anymore!411.0.6.142Fixed a bug with the script name431.0.6.244Fixed a few bugs related to unreachable logfile451.0.6.346Fixed date47Things to keep in mind48The log won't catch syntax errors49For some reason the paused event doesn't get fired when you restart the app, so new logs since the last pause won't be saved50logScript51?52*/53/*-----------54put this in script to use logScript55 56function log(){}try{return(function(){var logScript=getScriptByName('logScript');if(logScript){eval('function run(){'+logScript.getText()+'}');return run();}})();}catch(e){alert("At line "+e.lineNumber+": "+e);}/*logScriptEnd*/57//CONFIG58var logScript = {59  //logFilePath: "/storage/sdcard0/LightningLauncher/script/logScriptLog.html"60  logFilePath: "/storage/emulated/0/LightningLauncher/script/logScriptLog.html"61  , lineWrapping: true // might require app restart62  , bgColor: 0xff19191963  , textColors: ["#d0d0d0", "#ee7600"] // the script iterates through these colors with each new "session"64  , logLevel: {65    NORMAL: {66      name: "[NORMAL]"67      , color: "#ffffff"68    }69    , DEBUG: {70      name: "[DEBUG]"71      , color: "#0000ff"72    }73    , ERROR: {74      name: "[ERROR]"75      , color: "#ff0000"76    }77  }78  , defaultLogLevel: "NORMAL"79  , saveMode: true80    // END CONFIG81  , currentScript: getCurrentScript()82  , getScript: function() {83    return this.script = this.script || getScriptByName("logScript");84  }85  , scrollDown: function(sv) {86    sv.post(new Runnable() {87      run: function() {88        sv.fullScroll(ScrollView.FOCUS_DOWN);89      }90    });91  }92  , getCVItem: function() {93    if(!this.cvItem) {94      this.cvItem = getActiveScreen().getAllItemsById(this.getScript().getTag("cvId"))[0];95      if(!this.cvItem) throw new Error("Custom view not found!")96    }97    return this.cvItem98  }99  , getCV: function() {100    if(!this.cv) {101      this.cv = this.getCVItem().getView()102      if(!this.cv) throw new Error("Custom view not loaded!");103    }104    return this.cv105  }106  , getSV: function() {107    if(!this.sv) {108      var cv = this.getCV()109      for(var i = 0; i < cv.getChildCount(); i++) {110        this.sv = cv.getChildAt(i);111        if(this.sv.getTag() == "sv")112          break;113      }114    }115    return this.sv116  }117  , getTV: function() {118    if(!this.tv)119      this.tv = this.getSV().getChildAt(0);120    return this.tv121  }122  , createCVItem: function(c) {123    var script = getCurrentScript();124    var scriptId = script.getId();125    var cv = c.addCustomView(0, 0);126    var prop = cv.getProperties().edit();127    script.setTag("cvId", cv.getId());128    prop.getBox("i.box").setColor("c", "n", logScript.bgColor);129    prop.setString("v.onCreate", scriptId).commit();130    prop.setEventHandler("i.resumed", EventHandler.RUN_SCRIPT, scriptId);131    prop.setEventHandler("i.paused", EventHandler.RUN_SCRIPT, scriptId);132    prop.commit();133    return cv;134  }135  , isTVAvailable: function() {136    try {137      logScript.getTV()138      return true;139    } catch(e) {140      if(e.message != "Custom view not found!" && e.message != "Custom view not loaded!") {141        throw e;142      }143      return false;144    }145  }146};147 148bindClass("java.io.File");149bindClass("java.io.FileWriter");150bindClass("java.io.PrintWriter");151bindClass("java.io.BufferedWriter");152bindClass("android.widget.TextView");153bindClass("android.text.method.ScrollingMovementMethod");154bindClass("android.text.Html");155bindClass("java.io.BufferedReader");156bindClass("java.io.FileReader");157bindClass("android.widget.ScrollView");158bindClass("android.view.View");159bindClass("java.lang.Runnable");160bindClass("android.widget.Button");161bindClass("android.widget.FrameLayout");162bindClass("android.view.Gravity");163 164//function log(text, logLevel /**/ ) {165function log(text, logLevel) {166  logLevel = logLevel || logScript.logLevel[logScript.defaultLogLevel];167 168  for(var i = 2; i < arguments.length; i++) {169    var newText = text.replace("{}", arguments[i]);170    if(newText == text) {171      break;172    } else {173      text = newText;174    }175  }176 177  var date = new Date();178  var logText = "<font color=#add8e6>" + date.getDate() + "-" + (date.getMonth() + 1) +179    "</font>" + " <font color=#ffff00>" + date.toTimeString().slice(0, 8) +180    "</font>" + " <font color=#00ff00>" + logScript.currentScript.getName() + "</font>" +181    " <font color=" + logLevel.color + ">" + logLevel.name + "</font>" + ": " +182    " <font color=" + logScript.textColors[logScript.ind] + ">" + text +183    "</font>";184 185  if(logScript.isTVAvailable()) {186    var tv = logScript.getTV()187    var tvOldLength = tv.length()188    tv.append(Html.fromHtml(logText).append("\n"));189    logScript.scrollDown(logScript.getSV());190    if(logScript.saveMode) {191      var script = logScript.getScript()192      var prevLogInd = script.getTag("prevLogInd") || -1193      var prevLog = JSON.parse(script.getTag("log" + prevLogInd))194      var tvNewLength = tv.length()195      if(prevLog && prevLog[1] == tvOldLength) {196        prevLog[1] = tv.length()197        script.setTag("log" + prevLogInd, JSON.stringify(prevLog));198      } else {199        prevLogInd++200        script.setTag("log" + prevLogInd, JSON.stringify([tvOldLength, tvNewLength]))201        script.setTag("prevLogInd", prevLogInd)202      }203    }204  } else {205    logScript.logText += logText;206  }207}208 209function cleanEval(text) {210  eval('function execute() {' + text + '}');211  execute();212}213 214return(function() {215  function read(filePath) {216    try {217      var r = new BufferedReader(new FileReader(filePath));218      var s = "";219      var l;220      while((l = r.readLine()) != null) s += (l + "\n");221      return s;222    } catch(e) {223      return "";224    }225  }226 227  if(logScript.currentScript.getName() == "logScript") {228    try {229      typeof item;230    } catch(e) {231      // in create232      var cv = item;233      var context = getActiveScreen().getContext();234      var tv = new TextView(context);235      var sv = new ScrollView(context);236      sv.addView(tv);237      sv.setTag("sv");238 239      tv.setMovementMethod(new ScrollingMovementMethod());240      tv.setTextColor(0xffffffff)241 242      cv.setVerticalGrab(true);243      tv.setVerticalScrollBarEnabled(true);244 245      if(!logScript.lineWrapping) {246        tv.setHorizontallyScrolling(true);247        cv.setHorizontalGrab(true);248      }249 250      var button = new Button(context);251      button.setText("clear log");252      button.setOnClickListener(new View.OnClickListener() {253        onClick: function(v) {254          new File(logScript.logFilePath).delete();255          try {256            logScript.getTV();257            tv.setText("");258            logScript.getScript().setTag("prevLogInd", null)259          } catch(e) {}260        }261      });262      button.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.TOP | Gravity.RIGHT));263 264      var layout = new FrameLayout(context);265      layout.addView(sv);266      layout.addView(button);267 268      logScript.scrollDown(sv);269      return layout;270    }271 272    var e = getEvent();273    var src = e.getSource();274    switch(src) {275      case "MENU_APP":276        //in container277        var cv = logScript.createCVItem(e.getContainer())278        cv.setPosition(e.getTouchX(), e.getTouchY())279        break;280      case "MENU_ITEM":281        var it = e.getItem();282        var c = it.getParent();283        var cv = logScript.createCVItem(c);284        cv.setSize(it.getWidth(), it.getHeight());285        cv.setPosition(it.getPositionX(), it.getPositionY())286        c.removeItem(it);287        break;288      case "I_RESUMED":289        // in resume290        var tv = logScript.getTV();291        try {292          var logFile = new File(logScript.logFilePath);293        } catch(e) {}294 295        if(logFile !== null && tv.getText().length() == 0 || logFile.lastModified() > logScript.getScript().getTag("lastLoaded")) {296          var savedLogText = read(logScript.logFilePath)297 298          if(savedLogText.length > 30000) {299            savedLogText = savedLogText.substring(savedLogText.length - 20000, savedLogText.length)300            savedLogText = savedLogText.substring(savedLogText.indexOf("<br>"), savedLogText.length);301          }302          tv.setText(Html.fromHtml(savedLogText));303          try {304            var pw = new PrintWriter(new File(logScript.logFilePath));305            pw.print("");306            pw.write(savedLogText);307          } catch(e) {} finally {308            if(pw) pw.close();309          }310          logScript.getScript().setTag("lastLoaded", new Date().getTime())311        }312        logScript.scrollDown(logScript.getSV());313        break;314      case "I_PAUSED":315        try {316          var bfWriter = new BufferedWriter(new FileWriter(new File(logScript.logFilePath), true));317          var unsavedLog;318          var i = 0;319          var script = logScript.getScript()320          while(unsavedLog = script.getTag("log" + i)) {321            var unsavedLog = JSON.parse(unsavedLog)322            var fullText = logScript.getTV().getEditableText();323            if(fullText && fullText.length() != 0 && fullText.length() >= unsavedLog[1]) {324              var unsavedLogTextString = Html.toHtml(fullText.subSequence(unsavedLog[0], unsavedLog[1]));325              bfWriter.append(unsavedLogTextString.substring(unsavedLogTextString.indexOf('>') + 1, unsavedLogTextString.lastIndexOf('<')));326            }327            script.setTag("log" + i, null)328            i++;329          }330          script.setTag("prevLogInd", null);331        } catch(e) {} finally {332          if(bfWriter) bfWriter.close();333        }334        break;335    }336  } else {337    //in eval()338    logScript.ind = parseInt(logScript.getScript().getTag("prevColorIndex") || "0");339    var tvAvailable = logScript.isTVAvailable()340    if(!tvAvailable)341      logScript.logText = "";342 343    var text = logScript.currentScript.getText();344    var returns = "";345    for(var i = 0; i < text.substr(0, text.search("var logScript")).split("\n").length; i++) {346      returns += "\n";347    }348    text = text.substr(text.search("logScriptEnd") + 12);349    if(text.charAt(0) == "*") {350      text = text.slice(2, text.length);351      returns = returns.slice(1, returns.length);352    }353    var counter = 0;354    for(var i = 0; i < text.length; i++) {355      if(text.charAt(i) == "{")356        counter++;357      else if(text.charAt(i) == "}")358        counter--;359 360      if(counter < 0) {361        break;362      }363    }364    text = returns + text.slice(0, i);365 366    try {367      return cleanEval(text);368    } catch(e) {369      log("At line " + e.lineNumber + ": " + e, logScript.logLevel.ERROR);370    } finally {371      logScript.getScript().setTag("prevColorIndex", logScript.ind == logScript.textColors.length - 1 ? 0 : logScript.ind + 1);372    }373 374    if(!tvAvailable) {375      try {376        var bfWriter = new BufferedWriter(new FileWriter(new File(logScript.logFilePath), true));377        bfWriter.append(logScript.logText)378      } catch(e) {379        alert("At line " + e.lineNumber + ": " + e);380      } finally {381        if(bfWriter) bfWriter.close();382      }383    }384  }385})();386/*387script_customviewlog.txt · Last modified: 2016/11/18 16:24 by cdfa388Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported...

Full Screen

Full Screen

logScript.ts

Source:logScript.ts Github

copy

Full Screen

1import * as dateFns from 'date-fns';2import * as crypto from 'crypto';3import * as fs from 'fs';4import * as path from 'path';5import * as mkdirp from 'mkdirp';6import * as chalk from 'chalk';7export class LogScript {8 public static instance: LogScript;9 private logScripts: [[string, string, string]];10 private path = path.resolve(path.join('src/static/logScripts/'));11 private backupPath = path.resolve(path.join(this.path, '/backup/'));12 private filename_prefix = "logScript";13 private backupFilename_prefix = "backup";14 private filename_postfix = "_" + dateFns.format(new Date(), 'yyMMdd') + '.json';15 private filename = path.resolve(path.join(this.path, "/", this.filename_prefix + this.filename_postfix));16 private backupFilename = path.resolve(path.join(this.backupPath, "/", this.backupFilename_prefix + "_" + this.filename_prefix + this.filename_postfix));17 constructor() {18 this.loadLogScripts();19 }20 static getInstance(): LogScript {21 if (!LogScript.instance) {22 LogScript.instance = new LogScript();23 }24 return LogScript.instance;25 }26 public addLogScriptTuple(script: string, nativeScript: string): void {27 let logScripts = this.getLogScripts();28 if (logScripts === undefined) {29 logScripts = new Array(this.logScriptTupleGenerator(script, nativeScript));30 } else {31 logScripts.push(this.logScriptTupleGenerator(script, nativeScript));32 }33 }34 public getLogScripts(): [[string, string, string]] {35 return this.logScripts;36 }37 public printLogScripts(): void {38 console.log(this.getLogScripts());39 }40 public saveLogScripts(): void {41 const scripts = this.getLogScripts();42 // 경로에 해당하는 디렉토리가 없으면 폴더를 생성43 mkdirp.sync(this.backupPath);44 try {45 fs.writeFileSync(this.filename, JSON.stringify(scripts), { mode: 0o777 });46 fs.writeFileSync(this.backupFilename, JSON.stringify(scripts), { mode: 0o777 });47 console.log(chalk.green("logScripts Save success!"));48 } catch (err) {49 console.log(err);50 }51 }52 public findLogScripts(array: object, item: string): [[string, string, string]] | null {53 let count = 0;54 let result = null;55 if (!array) {56 console.log(chalk.yellow("Find log script : Error in array"))57 } else {58 for (let i = 0; i < array.length; i++) {59 for (let j = 0; j < 3; j++) {60 if (array[i][j] === item) {61 count++;62 result = array[i];63 console.log("Find log script : ", [i, j], array[i][j]);64 }65 }66 }67 if (count === 0) {68 console.log(chalk.yellow("Not exists keyword : " + item));69 } else {70 console.log("Find log script count : ", count);71 }72 }73 return result;74 }75 /**76 * 경로에서 파일을 찾아 logScripts 프로퍼티에 대입한다.77 */78 private loadLogScripts(): any {79 let file = this.filename;80 // 경로에 해당하는 디렉토리가 없으면 폴더를 생성81 mkdirp.sync(this.backupPath);82 // 1) 현재 파일 체크83 if (fs.existsSync(this.filename) === false) {84 console.log(chalk.yellow("Not exists log script file. Attempt to use backup file..."));85 // 2) 백업 파일 체크86 if (fs.existsSync(this.backupFilename)) {87 file = this.backupFilename;88 } else {89 let backupFilename = null;90 const searchKeyword = this.backupFilename_prefix + "_" + this.filename_prefix;91 const fileNames = fs.readdirSync(this.backupPath);92 fileNames.forEach((item) => {93 // FIXME: indexOf 메소드는 break 가 안됨.94 const target = item.lastIndexOf(searchKeyword);95 if (target !== (-1)) {96 backupFilename = path.resolve(path.join(this.backupPath, item))97 }98 });99 // 3) 원격 저장소에서 파일을 가져와서 사용100 if (backupFilename !== null) {101 file = backupFilename;102 } else {103 console.log(chalk.yellow("Not exists backup log script file!"));104 // TODO : 원격 저장소의 백업파일 로드105 }106 }107 }108 try {109 const loadScriptFile = fs.readFileSync(110 file, {111 encoding: 'utf8',112 flag: 'r'113 });114 if (!loadScriptFile) {115 console.log(chalk.yellow("Script setting error!"));116 }117 else if (loadScriptFile.length === 0) {118 console.log(chalk.yellow("Log script file is empty"));119 }120 else {121 console.log(chalk.green("Found log script file : " + file));122 this.logScripts = JSON.parse(loadScriptFile);123 if (this.logScripts) console.log(chalk.green("Log script load success!"));124 }125 } catch (err) {126 console.log("Load script file error : ", err);127 }128 }129 // TODO : 아래 메소드 로직도 확인해하고나서 파일 접근권한 체크에 사용해야함. 130 private accessPermissionCheck(): void {131 fs.access(this.path, fs.constants.F_OK, (err) => {132 if (err) {133 if (err) {134 console.log("%s doesn't exist", path);135 } else {136 console.log('can execute %s', path);137 }138 }139 });140 fs.access(this.path, fs.constants.R_OK | fs.constants.W_OK, (err) => {141 if (err) {142 console.log("%s doesn't exist", path);143 } else {144 console.log('can read/write %s', path);145 }146 });147 }148 private logScriptTupleGenerator(script: string, nativeScript: string): [string, string, string] {149 const randomValue = crypto.randomBytes(40).readUInt32BE().toString(16);150 const code = dateFns.format(new Date(), 'yyMMddHHmmss') + randomValue;151 return [code, script, nativeScript];152 }...

Full Screen

Full Screen

page.js

Source:page.js Github

copy

Full Screen

...10}11// Adds an image to the place-holder div12function addImg(index, src) {13 const url = normalizeUrl(src);14 logScript('Image:', index, 'Source:', url);15 $(`#PageImg${index}`).attr('src', url).parent().slideToggle();16 $(`#ThumbnailImg${index}`).attr('src', url);17 return index;18}19function addImgAlt(index, altsrc) {20 const url = normalizeUrl(altsrc);21 logScript('Image:', index, 'Alternative Source:', url);22 if (altsrc !== '') {23 $(`#PageImg${index}`).attr('altsrc', url);24 $(`#ThumbnailImg${index}`).attr('onerror', `this.src='${url}';this.onerror=null;`);25 }26 return index;27}28function getPage(url, wait = settings.Timer) {29 return new Promise((resolve) => {30 setTimeout(() => {31 logScript(`Getting page: ${url}`);32 $.ajax({33 type: 'GET',34 url,35 dataType: 'html',36 async: true,37 success: html => resolve(html),38 // retryCount and retryLimit will let you retry a determined number of times39 retryCount: 0,40 retryLimit: 10,41 // retryTimeout limits the total time retrying (in milliseconds)42 retryTimeout: 10000,43 // timeout for each request44 timeout: 1000,45 // created tells when this request was created46 created: Date.now(),47 error() {48 this.retryCount += 1;49 if (this.retryCount <= this.retryLimit && Date.now() - this.created < this.retryTimeout) {50 logScript(`Retrying Getting page: ${url}`);51 $.ajax(this);52 } else {53 logScript(`Failed Getting page: ${url}`);54 }55 },56 });57 }, wait);58 });59}60const loadMangaPages = (begin, manga) =>61 mapIndexed(62 (url, index) => (index >= begin ? getPage(url,63 (manga.timer || settings.Timer) * (index - begin))64 .then(response => addImg(index + 1, $(response).find(manga.img).attr('src'))) : null),65 manga.listPages);66function getImages(src, wait = settings.Timer) {67 return new Promise((resolve) => {68 setTimeout(() => {69 resolve(src);70 }, wait);71 });72}73const loadMangaImages = (begin, manga) =>74 mapIndexed(75 (src, index) => (index >= begin ? getImages(src,76 (manga.timer || settings.Timer) * (index - begin))77 .then(response =>78 addImg(index + 1, response)) : null),79 manga.listImages);80const loadMangaImagesAlt = (begin, manga) =>81 mapIndexed((src, index) => (index >= begin ? addImgAlt(index + 1, src) : null),82 manga.listImagesAlt);83function loadManga(manga, begin = 1) {84 logScript('Loading Images');85 logScript(`Intervals: ${manga.timer || settings.Timer || 'Default(1000)'}`);86 if (manga.listPages !== undefined) {87 logScript('Method: Pages:', manga.listPages);88 loadMangaPages(begin - 1, manga);89 } else if (manga.listImages !== undefined) {90 logScript('Method: Images:', manga.listImages);91 loadMangaImages(begin - 1, manga);92 if (manga.listImagesAlt !== undefined) {93 loadMangaImagesAlt(begin - 1, manga);94 }95 } else {96 logScript('Method: Brute Force');97 manga.bruteForce({98 begin,99 addImg,100 loadMangaImages: R.curry(loadMangaImages)(begin - 1),101 loadMangaPages: R.curry(loadMangaPages)(begin - 1),102 getPage,103 getImages,104 wait: settings.timer,105 });106 }107}108// Force reload the image109function reloadImage(img) {110 const src = img.attr('src');111 const altsrc = img.attr('altsrc');112 if (src !== undefined) {113 if (altsrc !== undefined) {114 img.removeAttr('src');115 img.removeAttr('altsrc');116 setTimeout(() => {117 img.attr('src', altsrc);118 img.attr('altsrc', src);119 }, 500);120 } else {121 img.removeAttr('src');122 setTimeout(() => {123 img.attr('src', src);124 }, 500);125 }126 }127}128// After pages load apply default Zoom129function applyZoom(page, newZoom) {130 const zoom = newZoom || settings.Zoom;131 const pages = page || '.PageContent img';132 $(pages).each((index, value) =>133 $(value)134 .width(zoom === 1000 ? $('html').width() : $(value).prop('naturalWidth') * (zoom / 100)));135}136// Checks if all images loaded correctly137function checkImagesLoaded(manga) {138 const images = $('.PageContent img').get();139 const total = images.length;140 const missing = images.filter(item => $(item).prop('naturalWidth') === 0);141 const loaded = images.filter(item => $(item).prop('naturalWidth') !== 0);142 loaded.filter(item => $(item).attr('width') === undefined)143 .forEach(item => applyZoom($(item)));144 missing.forEach(item => reloadImage($(item)));145 NProgress.configure({146 showSpinner: false,147 }).set(loaded.length / total);148 $('#Counters i, #NavigationCounters i').html(loaded.length);149 logScript(`Progress: ${Math.floor((loaded.length / total) * 100)}%`);150 $('title').html(`(${Math.floor((loaded.length / total) * 100)}%) ${manga.title}`);151 if (loaded.length < total) {152 setTimeout(() => checkImagesLoaded(manga), 5000);153 } else {154 logScript('Images Loading Complete');155 // $('title').html(manga.title);156 // Clear used Bookmarks157 settings.bookmarks = settings.bookmarks.filter(el => el.url !== location.href);158 setValueGM('MangaBookmarks', JSON.stringify(settings.bookmarks));159 $('.download').attr('href', '#download');160 logScript('Download Avaliable');161 if (settings.DownloadZip) {162 $('#blob').click();163 }164 }165}166export {167 loadManga,168 checkImagesLoaded,169 applyZoom,170 reloadImage,171 getPage,...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1wptHook.logScript("test.js");2wptHook.logScript("test2.js");3wptHook.logScript("test3.js");4wptHook.logScript("test4.js");5wptHook.logScript("test5.js");6wptHook.logScript("test6.js");7wptHook.logScript("test7.js");8wptHook.logScript("test8.js");9wptHook.logScript("test9.js");10wptHook.logScript("test10.js");11wptHook.logScript("test11.js");12wptHook.logScript("test12.js");13wptHook.logScript("test13.js");14wptHook.logScript("test14.js");15wptHook.logScript("test15.js");16wptHook.logScript("test16.js");17wptHook.logScript("test17.js");

Full Screen

Using AI Code Generation

copy

Full Screen

1wptLog.logScript("test.js", "Test script");2wptLog.logScript("test2.js", "Test script2");3wptLog.logScript("test3.js", "Test script3");4wptLog.logScript("test4.js", "Test script4");5wptLog.logScript("test5.js", "Test script5");6wptLog.logScript("test6.js", "Test script6");7wptLog.logScript("test7.js", "Test script7");8wptLog.logScript("test8.js", "Test script8");9wptLog.logScript("test9.js", "Test script9");10wptLog.logScript("test10.js", "Test script10");11wptLog.logScript("test11.js", "Test script11");12wptLog.logScript("test12.js", "Test script12");13wptLog.logScript("test13.js", "Test script13");14wptLog.logScript("test14.js", "Test script14");15wptLog.logScript("test15.js", "Test script15");

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt.logScript("Script is running");2wpt.logData("This is a test");3wpt.logError("This is an error");4wpt.logWarning("This is a warning");5wpt.logInfo("This is an info message");6wpt.logDebug("This is a debug message");7wpt.logVerbose("This is a verbose message");8wpt.logCustom("This is a custom message");9wpt.logEvent("This is an event");10wpt.logException("This is an exception");11wpt.logMetric("This is a metric");12wpt.logPageView("This is a page view");13wpt.logPageAction("This is a page action");14wpt.logTrace("This is a trace");15wpt.logRequest("This is a request");16wpt.logDependency("This is a dependency");17wpt.logAvailability("This is an availability");18wpt.logPerformanceCounter("This is a performance counter

Full Screen

Using AI Code Generation

copy

Full Screen

1function logScript() {2 if (typeof wptLog !== 'undefined') {3 wptLog.logScript("test.js");4 }5}6logScript();

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