WebView-GM

Additional

Language
Java
Version
v1.2.0 (Jan 23, 2016)
Created
Mar 7, 2012
Updated
Mar 17, 2022 (Retired)
Owner
Werner Bayer (wbayer)
Contributors
Werner Bayer (wbayer)
Richard Broker (rbroker)
Warren Bank (warren-bank)
3
Activity
Badge
Generate
Download
Source code

WebView-GM

This library for Android projects adds Greasemonkey-compatible user script support to standard WebView components (version 2.2+).

Usage

Gradle
dependencies {
    compile 'at.pardus.android:webview-gm-lib:1.2.0'
    compile 'at.pardus.android:webview-gm-ui:1.2.0'
}
Maven
<dependency>
    <groupId>at.pardus.android</groupId>
    <artifactId>webview-gm-lib</artifactId>
    <version>1.2.0</version>
</dependency>
<dependency>
    <groupId>at.pardus.android</groupId>
    <artifactId>webview-gm-ui</artifactId>
    <version>1.2.0</version>
</dependency>
  • Create a new ScriptStoreSQLite object for script and value persistence, or implement your own ScriptStore.
  • Make the WebView class that you want to run scripts in extend WebViewGm, or use the ScriptBrowser class in the UI module.
  • Handle the management of scripts using the classes in the UI module, or extend them, or implement your own.

The demo module contains an implementation of the library and all its components. It uses a single WebView for both the download of user scripts and running them.

Apps using it

Pardus Android

Limitations

GM_xmlhttpRequest implementation is missing an "abort()" callback.

ToDo

Contributing

Fork the repository and send a pull request: https://help.github.com/articles/using-pull-requests/