Git Product home page Git Product logo

abp-lightning-browser's Introduction

Lightning Browser Adblock Plus Android SDK integration

Purpose

This is a fork of Lightning Browser with integrated Adblock Plus Android SDK. It is created to provide the reference implementation of Adblock Plus Android SDK browser integration.

Disclaimer

Be aware that there are NO GUARANTEES for stability and availability of the Reference Implementation! We believe that the Lightning Browser is stable, as are the Adblock Plus code and Adblock Plus integration changes, but the resulting application is not tested to be production ready.

Features

This reference integration inherits all the Lightning Browser features, adding the Adblock Plus features. The Lightning Browser already contains an adblocking solution. It is shown as Ad Block Settings in Settings, while Adblock Plus is added as Adblock Plus.

  • Adblock Plus with Acceptable Ads.

  • AdBlock Plus Settings interface.

Implementation details

Adblock Plus Engine

The Adblock Plus Engine is required for AdblockWebView to function, and should be initialized as early as possible. The Engine is is integrated by adding imports and initialization (via AdblockHelper) to BrowserApp.kt. Please note the Timber initialization a bit earlier.

AdblockWebView

AdblockWebView is integrated by adding imports and changing the construction of WebView to that of AdblockWebView to LightningView.kt. An important part is the disposal of AdblockWebView.

AdblockWebView testing adaptation

To make it easy to switch between Android WebView and AdblockWebView at runtime, a new variable isAdblockWebView is introduced in BrowserActivity.kt.

Settings

The settings are integrated by adding the Settings Activity for Adblock Plus (AdblockPlusSettingsActivity.kt) and adding the header entry for the Activity. There is also a string resource for Adblock Plus Settings. We had to create a separate activity to host our settings fragments as a workaround.

Resources

There are two preloaded files for the subscriptions: easylist.txt and exceptionrules.txt. The files are also updated by a gradle task. Having those files included in the application allows Adblock Plus to function properly even before the subscriptions are downloaded for the first time.

Build tools

Testing

There is a WebViewLoadUrlPerfTest.kt test that aims to compare page load times in Android WebView and AdblockWebView, and also does some analysis on the load times.

abp-lightning-browser's People

Contributors

alt-grr avatar androidol avatar anthonycr avatar badener95 avatar bboa avatar bebolint98 avatar bytehamster avatar cagatayldzz avatar creatieai avatar david-guillot avatar eyeojeff avatar fastboot-zz avatar ikirby avatar karolba avatar lordsomen avatar markthat avatar n8fr8 avatar pan93412 avatar rakom27 avatar roboe avatar smarquespt avatar stellasythe avatar str4d avatar t61p avatar takahirom avatar user99gmxat avatar xpirt avatar ys-j avatar yuvalabou avatar zoraver avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.