Creates a Conduit object which allows Java to wrap Javascript code within a
handler that will foward evaluation results back to the Java process.
Inherited methods
From
class
java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final
Class<?>
getClass()
int
hashCode()
final
void
notify()
final
void
notifyAll()
String
toString()
final
void
wait(long arg0, int arg1)
final
void
wait(long arg0)
final
void
wait()
Public constructors
JavaScriptBridge
JavaScriptBridge ()
Public methods
installBridge
void installBridge ()
Sets up Java / Javascript bridging on every WebView in the app.
This method must be called very early (eg: before webviews are loaded in your app).
GoogleInstrumentation invokes this method if this library is present on your classpath.
This method must be called from the main thread. It'll return immedately if the bridge
is already installed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-11 UTC."],[],[],null,["# JavaScriptBridge\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nJavaScriptBridge\n================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\nfinal\n\nclass\nJavaScriptBridge\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-----------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.test.espresso.web.bridge.JavaScriptBridge |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nProvides a gateway for Java and Javascript code to communicate to eachother.\n\nSummary\n-------\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------|---|\n| ` `[JavaScriptBridge](/reference/android/support/test/espresso/web/bridge/JavaScriptBridge#JavaScriptBridge())`() ` |\n\n| ### Public methods ||\n|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static void` | ` `[installBridge](/reference/android/support/test/espresso/web/bridge/JavaScriptBridge#installBridge())`() ` Sets up Java / Javascript bridging on every WebView in the app. |\n| ` static `[Conduit](/reference/android/support/test/espresso/web/bridge/Conduit) | ` `[makeConduit](/reference/android/support/test/espresso/web/bridge/JavaScriptBridge#makeConduit())`() ` Creates a Conduit object which allows Java to wrap Javascript code within a handler that will foward evaluation results back to the Java process. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### JavaScriptBridge\n\n```\nJavaScriptBridge ()\n```\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### installBridge\n\n```\nvoid installBridge ()\n```\n\nSets up Java / Javascript bridging on every WebView in the app.\n\nThis method must be called very early (eg: before webviews are loaded in your app).\nGoogleInstrumentation invokes this method if this library is present on your classpath.\n\nThis method must be called from the main thread. It'll return immedately if the bridge\nis already installed. \n\n### makeConduit\n\n```\nConduit makeConduit ()\n```\n\nCreates a Conduit object which allows Java to wrap Javascript code within a\nhandler that will foward evaluation results back to the Java process.\n\nConduits can be used for only 1 evaluation. Creating new ones is relatively cheap.\n\n| Returns ||\n|------------------------------------------------------------------------|---|\n| [Conduit](/reference/android/support/test/espresso/web/bridge/Conduit) | |\n\n-\n\n Classes\n -------\n\n - [Conduit](/reference/android/support/test/espresso/web/bridge/Conduit)\n - [JavaScriptBridge](/reference/android/support/test/espresso/web/bridge/JavaScriptBridge)"]]