diff --git a/src/bypasses/letsboost.js b/src/bypasses/letsboost.js index 09c2ee5a..91d685c9 100644 --- a/src/bypasses/letsboost.js +++ b/src/bypasses/letsboost.js @@ -2,14 +2,22 @@ import BypassDefinition from './BypassDefinition.js' export default class Letsboost extends BypassDefinition { constructor() { - super() - this.ensure_dom = true + super(); + this.ensure_dom = true; } execute() { - const jsonDat = window.JSON.parse(stepDat); - this.helpers.safelyNavigate(jsonDat[jsonDat.length-1]["url"]); + alert("FastForward: If nothing happens in a few seconds, the bypass couldn't be executed. Please disable your ad blocker and refresh the page. Press OK to continue."); + this.helpers.insertInfoBox("If nothing happens in a few seconds, the bypass couldn't be executed. Please disable your ad blocker and refresh the page."); + this.helpers.awaitElement("script:last-of-type:not([src])", () => { + const lastScript = document.getElementsByTagName('script')[document.getElementsByTagName('script').length - 1]; + const scriptContent = lastScript.innerHTML; + const jsonDat = JSON.parse(scriptContent.match(/stepDat = '(.*)';/)[1]); + const url = jsonDat[jsonDat.length-1]["url"]; + this.helpers.safelyNavigate(url); + }); } } -export const matches = ['letsboost.net'] \ No newline at end of file + +export const matches = ['letsboost.net']; \ No newline at end of file