Ad Blockers Development Guide

As of 4.0, Samsung Internet for Android allows third-party apps to provide filters for Ad blocking. You can let users browse the web without unnecessary advertisements cluttering their screens.

Block advertisements OFF Block advertisements ON

Overview

Samsung Internet for Android uses the filter data provided by your apps to tidy up web pages shown to users.

Block Content Block Content

In Samsung Internet for Android, the Ad blockers menu is located in the Add-ons (or Extensions in older versions) page and the pre-registered Ad blocking apps will be listed when the menu is selected.

Details for registering your app to Samsung Internet for Android is described in the Basic Guidelines section. Once registered, your app will be listed together with other pre-registered Ad blocking apps.

When your app is enabled, it will be downloaded from the registered app store and installed. Then Samsung Internet for Android will request your app to send the filter data and start using the received filter data when rendering web pages. Up to 5 Ad blocking apps can be enabled and used simultaneously.

Basic Guidelines

Filter Format

Samsung Internet for Android works with filters following the widely known Adblock Plus filter (adblockplus.org/filters) format packaged into android APK packages.

App Registration

To register your app to Samsung Internet for Android, the following preconditions need to be met.

  1. The ContentProvider’s authority string should follow this format.

    <provider>
    android:name="com.example.sampleApp.sampleContentProvider"
    android:authorities="< your_package_name >.contentBlocker.contentProvider"
    android:exported="true">
    </provider>
    
  2. Add the following uses-permission in your AndroidManifest.xml file.

    <uses-permission android:name="com.samsung.android.sbrowser.permission.CONTENTBLOCKER" />
    
  3. Include the version info for our Ad blockers interface in your AndroidManifest.xml file.

    <meta-data android:name="com.samsung.android.sbrowser.contentBlocker.interfaceVersion" android:value="API_1.0" />
    
Validation Process

The validation process from Samsung is designed to make sure that the interface between the add-on app and Samsung Internet for Android is working properly, and the add-on app can be properly enabled and disabled from Samsung Internet for Android. The intent of the validation process is to make sure that the app is not misleading the user.

You need to send the final APK package of your app to cb.web@samsung.com and follow the validation process before uploading your app to public app markets.

Detailed guidelines will be provided through e-mail, and the validation process takes about 1 to 2 week(s). Once validated, the package name and signature will be registered, and your app can be used by Samsung Internet for Android.

* Samsung reserves the rights to change the validation process without prior notice.

Updating Filter Data

Samsung Internet for Android will request the up-to-date filter data from your app whenever needed. Or, you can send a broadcast message with the intent action and data set following the below format.

Intent intent = new Intent();
intent.setAction("com.samsung.android.sbrowser.contentBlocker.ACTION_UPDATE");
intent.setData(Uri.parse("package:<your_package_name>"));
sendBroadcast(intent);</your_package_name>
Launching Ad blockers menu in Samsung Internet for Android Settings

You can launch the Ad blockers setting menu of Samsung Internet for Android from your app with startActivity(Intent).

Intent intent = new Intent();
intent.setAction("com.samsung.android.sbrowser.contentBlocker.ACTION_SETTING");
List<ResolveInfo> list = getPackageManager().queryIntentActivities(
intent, PackageManager.MATCH_DEFAULT_ONLY);
If (list.size() > 0) {
startActivity(intent);
}
Development Mode

Samsung Internet for Android provides a development mode for Ad blockers, so you can test your app before carrying out the validation process.

Install your app to your test device and type "internet://contentblock" in the URL bar of Samsung Internet for Android to enable development mode. If you launch the Add-ons menu in Settings with the development mode enabled, you will be able to select and test your Ad blocking app even if it is not validated.

Restrictions

Supported devices: Ad blockers feature is supported on every Android device with Samsung Internet for Android 4.0 and later. However, only the Samsung Galaxy devices can browse and download the pre-registered Ad blocking apps in Galaxy store. Non-Samsung Galaxy devices can download the pre-registered Ad blocking apps in the Google Play store only. Hence, for some non-Samsung Galaxy devices without Google Play Service, the Ad blockers feature will be disabled because it’s not possible to download the pre-registered Ad blocking apps from Galaxy store and Google Play store.

Developer Feedback

For more details or inquiries, please contact cb.web@samsung.com.