Declarative Web Request API Sample
Item logo image for Declarative Web Request API Sample

Declarative Web Request API Sample

Developer Tools8 users
Item media 1 screenshot

Overview

Declarative Web Request API Note: The [declarative web request API](https://developer.chrome.com/extensions/declarativeWebRequest)…

Declarative Web Request API Note: The [declarative web request API](https://developer.chrome.com/extensions/declarativeWebRequest) is available only on the [beta channel](https://www.google.com/landing/chrome/beta/) and [dev channel](http://www.chromium.org/getting-involved/dev-channel). This sample will not work on stable channel builds. This sample shows how to use the declarative web request API with a webview. The app implements a simple content blocker for URLs that match a RE2 regular expression. The default pattern blocks hosts that contain blogspot. (such as blogspot.com blogs) or gstatic. (such as thumbnails in Google image search). Top frame and sub-frame navigation redirects the whole webview to a "page blocked" page (see screenshot left). Image loads are redirected to a dummy image that contains a shortened version of the image URL as text (see screenshot right). The user can modify the URL matching pattern using a form on the top-right. Content blocking actions are logged beneath the form on the top-right. See the source code at https://github.com/GoogleChrome/chrome-app-samples/tree/master/webview-samples/declarative-web-request This version was built from git commit 8dfb9ab https://github.com/GoogleChrome/chrome-app-samples/tree/8dfb9ab/webview-samples/declarative-web-request

0 out of 5No ratings

Google doesn't verify reviews. Learn more about results and reviews.

Details

  • Version
    2.0
  • Updated
    June 18, 2014
  • Offered by
    Chrome App Samples
  • Size
    120KiB
  • Languages
    English (United States)
  • Non-trader
    This developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.

Privacy

The developer has not provided any information about the collection or usage of your data.

Support

For help with questions, suggestions, or problems, visit the developer's support site

Google apps