-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contentscript.js:77 Uncaught Error: uBlock Origin: aborting content scripts for http://limonte.github.io/svg/head.svg.xml #2029
Comments
Sort of by design -- the browser injects uBO's content script into a document which is not meant to be handled by uBO, and throwing is used as a mean to "return" from the script. |
Thank you @gorhill for the quick response, what you're saying makes sense. Is there any workaround to get rid of that exception in console? |
I could wrap the whole code in the file into a single |
That will be much better solution, as to me. |
Yeah, screw performance, I want no JS errors ever, not even the ones that users wouldn't see! 🙄 |
Warning: below is off-topic: @lewisje I saw your answer on ABP's board, I have to ask about:
I have no idea what you are referring to there. uBO does not remove hidden DOM elements. (I have considered a By the way, the original post had a different title and was much longer -- probably has been silently redacted by the moderators. |
I don't notice the original post in that thread, or my own reply, having been shortened. Anyway, I didn't find much support for the notion that uBO removes elements from the DOM via cosmetic filtering in any case, but I did see this mention in the wiki: https://github.com/gorhill/uBlock/wiki/Inline-script-tag-filtering#why-is-the-new-inline-script-tag-filter-a-cosmetic-one
I have edited my post on the ABP forum to grey-out sections referring to the notion that ABP removes DOM elements. |
Yeah, bad wording -- I edited to the more accurate "hiding". |
I meant the original OP's post, not yours. |
I get the same issue reported in the OP. You can see it, for example, viewing this: While I appreciate the users can't see these errors, they do spam out the console needlessly and make it harder to debug JS on sites which include SVGs. I get the same error repeated for every SVG on a page; on one site I'm working on, this means 8 or 9 "bogus" console errors on a page. From a first-principles standpoint, if uBlock detects it's injected into an inapplicable context, why does it need to throw an Error? This isn't really an "application error" so much as the plugin correctly exiting when it's not needed. It seems like the kind of logging which would be valid in development, but not in an end-user context. |
This is not uBO outputting at the console, it is the browser reporting an uncaught (yet harmless in the current case) exception. |
I beg pardon, that's my language at fault. That should read, "It seems like throwing an Error here would make sense in development, but not in an end-user production context." I do disagree that it's harmless. Unneeded exceptions decrease the signal-to-noise ratio and can make it harder to spot JS errors which actually need fixing in a web app. If a program's behavior encourages you to ignore exceptions, then we can probably agree that's a bad outcome. I'm unclear why you prefer to keep this Error; I could see it being useful in dev to pass tests etc., but in a production system it adds no value. Is there a benefit to keeping it? |
I do not expect this to change your opinion. |
OK, sure, I understand. I disagree that it's rare, since SVGs are becoming much more prevalent across the web. I assume this will consequently be closed as WONTFIX but as you can probably gather, my vote would be for fixing this for the reasons I outlined. |
I keep it open because my mind is not 100% made whether I should fix this or not -- I am opened to all arguments. |
Well, if it helps to sway you, this feels more like a temporary hack than a long-term solution. Using an exception to control program flow is abusing the exception. |
This appears to be part of another fix for uBlock-LLC/uBlock#456 and like Jestar342 I see this same problem, even when I've disabled uBlock for the specific site with the power button as described in uBlock-LLC/uBlock#1641 My scenario is the development of an application which uses SVG's to show a weather forecast, meaning I get to see this error at minimum 7 times in the console and 40+ times if all of the options are expanded to show hourly forecasts. And since all we're talking about here is these 3 lines of code: if ( typeof vAPI !== 'object' ) { It does seem overkill to have that many errors in the log just because uBlock can't be injected into an SVG, and even disabling it for the page doesn't help. |
Nothing to do with that issue, throwing pointless nonsensical speculations here just adds noise. It has been explained why this choice was made. Being forced to lock the thread. |
What is a site that causes the above error message? |
On sites I develop for. This is what facebook provides (this is the brand new 2017 tracking pixel). As both a developer and a user, I want to be able to gracefully respect when a user has an ad-blocker. To reproduce, simply visit https://www.facebook.com/tr with console open. |
Content scripts are not injected into images. I need a site making use of this to understand what is really happening. |
@gorhill Ok, here is a shot of the end result: For full reproduction:
The error will happen even with uBlock Origin turned off...there is something weird going on with that POST request to that tracking pixel. Edit: I should note that this is the vanilla behavior for the tracking script. (AFAIK) |
I am developing a SPA which makes heavy use of SVGs. Vivus is used to animate those SVGs. When loading the SVGs with Vivus (read: the SVGs are neither I learned in this thread that this error is harmless, still it decreases dev happiness since it makes finding real errors in the console somewhat hard. I have a lot of SVGs which produce a lot of those errors. The only fix...... for now is to filter all uBlock errors in the Chrome Console using |
Describe the issue
When opening http://limonte.github.io/ I'm getting uncaught exception in console
One or more specific URLs where the issue occurs
http://limonte.github.io/
Screenshot in which the issue can be seen
Your settings
Your filter lists
Default filter lists
The text was updated successfully, but these errors were encountered: