Interacting with the extension using JS
After the extension is initialized on the current active page, we have a global CMExtension object with which we can manipulate the extension settings.
Settings available for change:
Key | Type | Descriprion |
---|---|---|
|
| Is the extension enabled by default or nor |
|
| API key |
|
| List of captchas that are enabled (by default all capthas are enabled) |
|
| List of captchas that can be solved by clicks |
|
| Number of repeated solutions after an error |
|
| Whether the blacklist of sites specified in the IgnoreList field is enabled |
|
| List of sites to ignore the solving |
|
| Proxy settings |
|
| Is manual recognition enabled |
|
| Delay before solving captcha |
|
| Is the ability to automatically start captcha solving enabled |
|
| Is the ability to automatically solve the captcha window enabled |
| Boolean | Whether to save the selected elements on the site for text captcha |
| Number | Delay before starting to solve a text captcha, if it was saved for the site |
| String | DOM Element selector to click when starting a Recaptcha solving |
| String | DOM Element selector to click when starting a hCaptcha solving |
Note that event handlers are attached to the properties, not to the data inside.
Example:
window.CMExtension.isEnabled = false;
In addition to settings, there are events that we can subscribe to:
Event | Description |
---|---|
| The extension is fully loaded and ready to go |
| Start the hCaptcha solving |
| Server error when requesting hCaptcha solving results |
| Incorrect hCaptcha solving |
| Successful hCaptcha solving |
| Click on the hCaptcha checkbox |
Example:
window.addEventListener("onCMExtensionReady", () => {
// DO SOMETHING
})