Skip to content

Webview client with a whitelist of allowed URLs and download content using Phone's internal downloader.

Notifications You must be signed in to change notification settings

AshiVered/Android-Safe-browser

 
 

Repository files navigation

image

Android-Safe-browser

A simple Webview based browser with a whitelist of allowed URLs. It downloads content using the Phone's internal downloader. google-play-badge.png

TODO list

  • Move to base on Mozzila GeckoView, no Android System WebView
  • Real UI (No HTML)
  • Load url list&catgories list from server, for example with json.

Change default URL

Open app/src/main/java/com/webview/app/MainActivity.java and replace https://ashivered.github.io/listofurls.html on line 81 with the URL for your website

mWebView.loadUrl("https://ashivered.github.io/listofurls.html");

the default URL will be loaded when you open the app.

Change URLs in the Whitelist

Open app/src/main/java/com/webview/app/MainActivity.java and replace the URLs in line 85 with your URLs.

Change to a Blacklist Browser (List of disallowed URLs)

Reverse the condition (in lines 87-95):

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    String host = Uri.parse(url).getHost();
    if (whiteHosts.contains(host)) {
        return false;
    } else {
        blockString();
        return true;
    }

to

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    String host = Uri.parse(url).getHost();
    if (whiteHosts.contains(host)) {
        blockString();
        return true;
    } else {
        return false;
    }

About

Webview client with a whitelist of allowed URLs and download content using Phone's internal downloader.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%