Var c = false; while c =.

Rowbotham: Finally, I’m able to capture the error 99%. But there are times, it will still show the js exception. I am not sure really why :

Marcantel: The js exception i am able to capture now is Uncaught TypeError but sometimes, very rarely, it would still show up

Alliman: Zomg: I think I came up with a reasonable solution, unless you can think of a way to simplify this code

Alliman: OK, I’ve got some code now. Can anyone see any way to simplify this? tbh, it looks pretty good to me now

Pexsa: Kochel looked at the basilisk.

Hoeger: Is there a way to remove a div before the page is even loaded?

Scheurer: Here it is folks, the very complex and hard to catch js exception error –

Pexsa: Workisfun, Not before the div exists.

Goldberg: Pexsa:is it possible to catch the html before it’s drawn to the screen, take out some elements then let it be drawn?

Pexsa: Workisfun, Not unless you are loading the html yourself asynchronously.

Swims: Workisfun: yes. just load the page with sth like cheerio or as a string.

Moschetti: I’m trying to write an extension that takes out certain divs kind of like adblocker, would you guys know how adblocker removes ads before the page is even loaded?

Balfour: Then do your modification and then apply it to your window

Trucchi: Workisfun: it’s an extension, so it has access to native APIs you can’t get to from javascript alone

Signorile: Zumba_ad_: not the problem, but setInterval may be a better solution unless you want to make sure the request completes before making the request again in 5 seconds

Wakley: Trucchi: Avoid setInterval; use setTimeout instead.

Matthes: Trucchi:ahh knowing that javascript alone isn’t enough really helps, would you know which API is used?

Trucchi: Workisfun: depends on the browser, but it’d need to be able to intercept HTTP requests when they’re made, so it can check against its filter lists

Henges: Trucchi: only thing is it seems the same reasons are applicable to this use case with setTimeout as well

Trucchi: Workisfun: this is probably it, for chrome

Trucchi: Kevireilly: some of ’em, yeah. the big caveat to setInterval that isn’t in setTimeout is that setInterval doesn’t care at all about the status of the previous execution, or if there are failures, and will just keep on triggering

Marthaler: Oh I mean with the literal code provided, this is still the case

Corrio: Trucchi:thanks! I’ll go look at some examples for how to use it!

Moskop: I think on my original statement I should have appended “which you probably should be doing” :

Mickel: L have to use onComplete after the request for the html is done i think

Trucchi: Workisfun: oh, sure. but onComplete isn’t what the part of adblock that blocks requests before they’ve actually been made uses

Trucchi: It looks at where the request is being made and just requests it

Trucchi: For specific divs, if you mean the feature that lets you just kill the div, it simply nukes any divs you’ve told it to

Schmunk: Trucchi:i just need to nuke divs haha before they show up, not really block the requests actually. hmm

Wakley: Themanu: For help, ask your question. Be patient. Code samples should be pasted in a paste service see !paste. Tell us 1 what you want to happen, 2 what is actually happening, and 3 any error messages you find see !describe and !debug.

Puffinberger: Hi, I have this webpage that I am working on On line 13, there is a script that allows the user to open an image into the img. On lines 64 and 66, there are buttons that should apply a filter to that image it does not. What is the problem?

Schanz: Var c = false; while c = false { c = true; console.log’inside loop’; }