uBlock | uBlock Origin - An efficient blocker | Privacy library

 by   gorhill JavaScript Version: 1.50.0 License: GPL-3.0

kandi X-RAY | uBlock Summary

kandi X-RAY | uBlock Summary

uBlock is a JavaScript library typically used in Security, Privacy applications. uBlock has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has medium support. You can install using 'npm i @gorhill/ubo-core' or download it from GitHub, GitLab, npm.

uBlock Origin is NOT an "ad blocker": it is a wide-spectrum blocker -- which happens to be able to function as a mere "ad blocker". The default behavior of uBlock Origin when newly installed is to block ads, trackers and malware sites -- through EasyList, EasyPrivacy, Peter Lowe’s ad/tracking/malware servers, Online Malicious URL Blocklist, and uBlock Origin's own filter lists.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              uBlock has a medium active ecosystem.
              It has 36294 star(s) with 2720 fork(s). There are 865 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 13 open issues and 3437 have been closed. On average issues are closed in 1678 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of uBlock is 1.50.0

            kandi-Quality Quality

              uBlock has 0 bugs and 0 code smells.

            kandi-Security Security

              uBlock has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              uBlock code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              uBlock is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              uBlock releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed uBlock and discovered the below as its top functions. This is intended to give you an instant insight into uBlock implemented functionality, and help decide if they suit your requirements.
            • Add Editor methods to editor instances .
            • Defines CodeMirror options .
            • Handles mouse click event .
            • Creates a widget .
            • Registers the event handlers for a mouse event .
            • Encode a string into an array of characters
            • Represents the CodeMirror editor .
            • Decode sequences of basic characters .
            • Draw a Selection Range
            • Compile an iterable item into a list
            Get all kandi verified functions for this library.

            uBlock Key Features

            No Key Features are available at this moment for uBlock.

            uBlock Examples and Code Snippets

            No Code Snippets are available at this moment for uBlock.

            Community Discussions

            QUESTION

            Is hiding Youtube Shorts elements with a bookmarklet possible?
            Asked 2022-Mar-19 at 15:45

            There is a uBlock filter floating around which hides all video thumbnails, if the time span of the associated text is shorter than 70 seconds:

            ...

            ANSWER

            Answered 2022-Jan-03 at 23:06

            I've found a working solution by myself, I wasn't aware of the fact that I have to do the search in javascript rather than in CSS selector. This line of code does exactly what I want:

            Source https://stackoverflow.com/questions/70560863

            QUESTION

            How to blur or hide runner thumbnails?
            Asked 2022-Jan-25 at 18:31

            I trying to blur or hide runner thumbnails on various streaming sites (PrimeVideo for example) I use Amino: Live CSS Editor chrome extension in most cases or uBlock Origin when I hide or blur certain elements from websites. But I can't understand how to blur that element. I mean these runner thumbnails don't even have divs, they just appear when you hover your mouse over progress bar and then disappear. With this css:

            ...

            ANSWER

            Answered 2022-Jan-25 at 18:31

            go to the img you want to blur, find a way to select it, and add to it:

            Source https://stackoverflow.com/questions/70852360

            QUESTION

            Network request failed from fetch in reactjs app
            Asked 2022-Jan-25 at 15:48

            I am using fetch in a NodeJS application. Technically, I have a ReactJS front-end calling the NodeJS backend (as a proxy), and then the proxy calls out to backend services on a different domain.

            However, from logging errors from consumers (I haven't been able to reproduce this issue myself) I see that a lot of these proxy calls (using fetch) throw an error that just says Network Request Failed, which is of no help. Some context:

            • This only occurs on a subset of all total calls (lets say 5% of traffic)
            • Users that encounter this error can often make the same call again some time later (next couple minutes/hours/days) and it will go through
            • From Application Insights, I can see no correlation between browsers, locations, etc
            • Calls often return fast, like < 100 ms
            • All calls are HTTPS, non are HTTP
            • We have a fetch polyfill from fetch-ponyfill that will take over if fetch is not available (Internet Explorer). I did test this package itself and the calls went through fine. I also mentioned that this error does occur on browsers that do support fetch, so I don't think this is the error.
            • Fetch settings for all requests
              • Method is set per request, but I've seen it fail on different types (GET, POST, etc)
              • Mode is set to 'same-origin'. I thought this was odd, since we were sending a request from one domain to another, but I tried to set it differently and it didn't affect anything. Also, why would some requests work for some, but not for others?
              • Body is set per request, based on the data being sent.
              • Headers is usually just Accept and Content-Type, both set to JSON.

            I have tried researching this topic before, but most posts I found referenced React native applications running on iOS, where you have to set some security permissions in the plist file to allow HTTP requests or something to do with transport security.

            I have implement logging specific points for the data in Application Insights, and I can see that fetch() was called, but then() was never reached; it went straight to the .catch(). So it's not even reaching code that parses the request, because apparently no request came back (we then parse the JSON response and call other functions, but like I said, it doesn't even reach this point).

            Which is also odd, since the request never comes back, but it fails (often) within 100 ms.

            My suspicions:

            1. Some consumers have some sort of add-on for there browser that is messing with the request. Although, I run with uBlock Origin and HTTPS Everywhere and I have not seen this error. I'm not sure what else could be modifying requests that would cause it to immediately fail.
            2. The call goes through, which then reaches an Azure Application Gateway, which might fail for some reason (too many connected clients, not enough ports, etc) and returns a response that immediately fails the fetch call without running the .then() on the response.

            For #2, I remember I had traced a network call that failed and returned Network Request Failed: Made it through the proxy -> made it through the Application Gateway -> hit the backend services -> backend services sent a response. I am currently requesting access to backend service logs in order to verify this on some more recent calls (last time I did this, I did it through a screenshare with a backend developer), and hopefully clear up the path back to the client (the ReactJS application). I do remember though that it made it to the backend services successfully.

            So I'm honestly not sure what's going on here. Does anyone have any insight?

            ...

            ANSWER

            Answered 2022-Jan-25 at 15:48

            Based on your excellent description and detective work, it's clear that the problem is between your Node app and the other domain. The other domain is throwing an error and your proxy has no choice but to say that there's an error on the server. That's why it's always throwing a 500-series error, the Network Request Failed error that you're seeing.

            It's an intermittent problem, so the error is inconsistent. It's a waste of your time to continue to look at the browser because the problem will have been created beyond that, either in your proxy translating that request or on the remote server. You have to find that error.

            Here's what I'd do... Implement brute-force logging in your Node app. You can use Bunyan, or Winston or just require(fs) and write out to some file when an error occurs. Then look at the results. Only log it out when the response code from the other server is in the 400 or 500 ranges. Log the request object and the response object.

            Something like this with Bunyan:

            Source https://stackoverflow.com/questions/70791538

            QUESTION

            Detect ONLY uBlock Origin adblocker (Vue)
            Asked 2021-Oct-15 at 05:37

            I'm using MoonPay for crypto purchasing in my Vue app, but uBlock Origin is blocking its IP address detection which blocks it from loading.

            It doesn't seem to be an issue on other adblockers, so I'd like to display a message to the user if the user has uBlock Origin installed, however the issue doesn't seem to occur with other adblockers.

            Is there a way to detect any one single adblocker, or a package which can return a string of the adblocker currently active?

            ...

            ANSWER

            Answered 2021-Oct-15 at 05:37

            as @ShadowRanger suggested, I've solve this by catching the Axios error from the blocked third-party resource fetch and displaying a modal to the user to alert them to the problem.

            Source https://stackoverflow.com/questions/69579804

            QUESTION

            Server-side Tag Manager/App Engine/Ad blocker: Any way to customize endpoint URL?
            Asked 2021-Oct-04 at 08:47

            I'm trying to keep count of the visitors to my blog (I'm using a static site published on Github Pages) and for that purpose I'm using Google Analytics 4.

            But I realized that ad blockers such as uBlock Origin block request to tag manager or analytics domains and even URL path segments like /gtm.js or /gtag/js?, see EasyPrivacy. So making the metric not very realistic as many people is using browser ad-blocking extensions.

            I've been reading recent articles about server side tagging, and how it can be used to deploy an App Engine instance for Tag Manager, and bypass ad blocking (between other goals). But as far as I can understand, doing it this way could bypass the domain blocking (e.g. www.googletagmanager.com), as tag manager becomes a first-party under your managed domain. But not to circumvent the blocking rules based on URL path. So,

            1. Is there any way to configure the server side tag manager to serve the JS scripts in different custom paths so that become impossible to block? If so, how can it be configured?

            2. In case it's possible, should I use directly the analytics script?

            ...

            ANSWER

            Answered 2021-Oct-03 at 23:18

            Seems like you're misunderstanding the concept of server-side GTM.

            The idea here is that the endpoint of your server-side GTM (the G Engine instance) is never exposed on front-end.

            So your back-end sends events to your App Engine instance, not the front-end. You typically don't need to deploy ANY code on the front-end. All logic is supposed to be set up solely on the backend. By your back-end developers. Your backend usually can listen to all the important events that are happening seemingly on the front-end. Like page navigations, form submissions, purchases, etc.

            You still can send seemingly front-end events to your server-side GTM. But you have to be smart about it. You don't want to expose your real GTM endpoint exactly to avoid bots, "hackers" and adblockers.

            So what you do instead, is:

            1. Build a custom "mirror" endpoint on your backend the main idea of which is to relay everything it gets to your App Engine GTM endpoint. Actually, it doesn't matter where you build the mirror endpoint. Your backend team would likely frown upon the idea of analytics contributing to "their" repos, so it may be a good idea to own your endpoint.
            2. Add protection, data enrichment, validation and logging to your mirror endpoint. It's optional, but it's good to have.
            3. Now use your new endpoint for the rare cases when you need to add front-end tracking to your existing back-end tracking. Addblockers will still block your front-end GTM, so you likely want to use something else (NOT a TMS) for your front-end code.
            4. Optionally, add some back-end logic to synchronize client ids between the backend events and your mirror endpoint events. And it's a lot easier if your mirror lives with your main back-end codebase, keep it in mind.

            Yes, server-side brings a lot of elegant solutions to modern tracking. It, however, requires the implementation specialists to be full-stack web-devs. And it's not typical for the industry. In fact, it's rare for the implementators to have even mid-JS dev skills, not mentioning full-stack or REST API experience.

            Source https://stackoverflow.com/questions/69429205

            QUESTION

            How to filter twitter "Follow topic" posts using ublock origin
            Asked 2021-Jun-01 at 22:07

            Twitter has started adding "follow topic" posts interspersed with the normal home timeline. I'd like to filter them out. Twitter actively obfuscates the timeline source to hinder efforts like this.

            Here's what I understand about the theory: the rule should be able to identify a post containing a deeply nested child that has the text "Follow Topic" in it, like so:

            img1

            then it should filter the post containing such a span, which would be this parent level

            img 2

            In practice I got as far as

            ...

            ANSWER

            Answered 2021-Jun-01 at 22:07

            To filter a node that contains another node, you can use the xpath() function.

            For example, to hide the article containing a recommended topic, I use:

            Source https://stackoverflow.com/questions/66241249

            QUESTION

            JavaScript to get Client IP Address bypassing Browser Extensions
            Asked 2021-May-09 at 02:00

            I am using an external API and part of the parameter of the API is an IP address. I looked up how to do it and I used the ipify version in this answer because it has no limitations. Here is the script:

            ...

            ANSWER

            Answered 2021-May-09 at 02:00

            You can use public services which are not blacklisted by ad blockers, like https://www.myexternalip.com/json but eventually it can also be blacklisted, it's not under your control.

            The most reliable way to reduce the risk of using a service that can be blacklisted would be building your own server as suggested in descriptions or keeping an updated list of alternative services in case of failed requests. Probably you won't get rid of your "problem" without spending some money.

            Source https://stackoverflow.com/questions/67406492

            QUESTION

            uBlock rule doesn't grip
            Asked 2021-Mar-10 at 10:10

            uBlock is blocking an ad from some website, but it leaves the large (in height) div which expands the site after loading and pushes the main text down. Using "Block is element" gives me

            ...

            ANSWER

            Answered 2021-Mar-10 at 10:10

            #js-ad-container-XYZ means you want to block the element with the id of js-ad-container-XYZ. With your second attempt you say to only block the div node(s) with that id. This will either do the same, worse case it would not match any nodes. I found you usually need to go expand the block to any number of parent nodes till you block the relevant container. For that you use the nth-ancestor():

            Source https://stackoverflow.com/questions/66561910

            QUESTION

            How can a browser be unable to block pop-ups?
            Asked 2021-Jan-08 at 11:09

            I'm using firefox v84 (latest atm) and i also have ublock installed. Firefox is set to block popups in it's settings, but i still get them (although rarely) from some sites. They pop up as very small windows at the corner of the screen. Sometimes it shows "firefox blocked popup", sometimes it doesn't. I remember reading about javascript trickery to somehow create popup windows even though it's blocked in the browser (so somehow it's still possible).

            Anyways, my main question is, how can a browser not be able to block the popups? I'm a programmer myself and i know that, for example, in windows environment, if you want to create a window, you need to call the windows api, and relevant functions (CreateWindowEx etc) to do that (even if you don't do it explicitly, that's what happens under the hood). Browser is also responsible for reading parsing and executing the javascript code. So just simply do NOT call the CreateWindow function, it should be that easy, is it not? Why is this still a problem, and why can't browser developers solve this?

            ...

            ANSWER

            Answered 2021-Jan-08 at 11:09

            Popups opened by the browser can (mainly and basically) be of 2 types :

            • Explicit javascript call to window.open
            • Implicit link with a target specified (i.e.: _blank)

            If you simply block both, then many legitimate websites will no longer work, for example (but not limited to) when using an OAuth mechanism to login.

            There are some patterns and rules that can be detected by the browser and the plugins to attempt blocking illegitimate popups. Example: the browser will block automatically any window.open that is not directly triggered by a user interaction (click on a button).

            There starts the cat and mouse game with people trying to circumvent known limitations and create inventive scenarios to force a popup to happen. Plugins in turn will try to catch those mechanisms and provide an updated detection behavior,...

            One common technique is indeed to combine the 2 popup methods and provide indirect page browsing. Example :

            Source https://stackoverflow.com/questions/65627240

            QUESTION

            How to block url or .js file execution on a specific using greasemonkey script? (client side)
            Asked 2020-Dec-26 at 06:33

            I want to stop a javascript .js to load on a specific website with greasemonkey/violentmonkey scrpit

            ...

            ANSWER

            Answered 2020-Dec-26 at 06:33

            The second method below usually works but something seems to be interfering with it on your page for some reason. An ugly workaround is to put an empty hljs property on the window in advance, so that the page script, when run, thinks it already exists and does nothing:

            Source https://stackoverflow.com/questions/65453565

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install uBlock

            Feel free to read about the extension's required permissions. You can install the latest version manually, from the Chrome Web Store, or from the Opera add-ons. There is also a development version in the Chrome Web Store if you want to test uBlock Origin with the latest changes: see uBlock Origin dev build. It is expected that uBlock Origin is compatible with any Chromium-based browsers. There is also a development version if you want to test uBlock Origin with the latest changes: for installation, see Install / Firefox webext / For beta version. uBlock Origin is compatible with SeaMonkey, Pale Moon, and possibly other browsers based on Firefox: for installation, see Install / Firefox legacy.
            Firefox 56-: apt-get install xul-ext-ublock-origin
            Firefox 55+: apt-get install webext-ublock-origin
            Deploying uBlock Origin Firefox: Deploying uBlock Origin for Firefox with CCK2 and Group Policy (external) Google Chrome: Managing Google Chrome with adblocking and security (external)

            Support

            Visit the uBlock Origin's wiki for documentation. For support/questions/help, there is /r/uBlockOrigin on Reddit.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Privacy Libraries

            Try Top Libraries by gorhill

            uMatrix

            by gorhillJavaScript

            httpswitchboard

            by gorhillJavaScript

            Javascript-Voronoi

            by gorhillJavaScript

            uBO-Extra

            by gorhillJavaScript

            cronexpr

            by gorhillGo