extension ExtPose

ROBOP

CRX id

ejnekllfbmdkabanimefejaidcgpcopk-

Description from extension meta

Support extension for ROBOP

Image from store ROBOP
Description from store The code is wrapped inside an immediately-invoked function expression (IIFE) (function(){ ... })() to create a local scope for the code. The code defines several variables such as port, portname, base_debug, and back_debug to be used later. The function BaseOnPortMessage is defined, which handles the messages received from the extension's background script. It checks the validity of the message and performs specific actions based on the message's functionName. The function BaseOnPortDisconnect is defined, which handles the disconnection of the port. It clears the port reference and attempts to reconnect after a timeout. The function Baseconnect is defined, responsible for establishing a connection with the native messaging port. It sets up listeners for message and disconnect events. The Baseconnect function is called to initiate the connection. Debug logging statements are printed if the back_debug flag is set. The variable roboputil_script is declared. The portname variable is assigned a string value. The lastwindowId variable is set to 1. The robopdebug variable is set to false. The code checks the browser type (Chrome, Firefox, or Edge) and assigns the corresponding value to the browser property in the message object. The SendToTab function is defined, which sends a message to a specific tab in a window. It uses the tabssendMessage function, waits for a response, and handles any errors or retries. The OnPortMessage function is defined, which handles the messages received from the native messaging port. It performs specific actions based on the message's functionName. Various actions are defined for different functionName values, such as enumerating windows, tabs, selecting a tab, updating a tab, closing a tab, and opening a URL. The getCurrentWindow function is called to get information about the current window. The code handles updating tab information, highlighting tabs, and opening URLs in tabs. Debug logging statements are printed if the back_debug flag is set. The OnPortMessage function is called to handle the received message. The code checks if the port variable is null or undefined and logs a warning if it is. The code returns the message object. Here is a breakdown of the major components and functionalities in the code: OnPortDisconnect: This function handles the disconnection of the native port. It checks for any errors and attempts to reconnect after a delay if there was an error. connect: This function establishes a connection with the native port. It first checks if there is an existing port and removes any event listeners associated with it. Then, it creates a new connection with the native port and adds event listeners for message reception and disconnection. EnumTabs: This function enumerates all the tabs in the browser and constructs a message with information about each tab. The message is sent to the native port. EnumWindows: This function enumerates all the windows in the browser and constructs a message with information about each window. The message is sent to the native port. OnPageLoad: This function sets up event listeners for window creation, removal, and focus change. When these events occur, corresponding messages are constructed and sent to the native port. tabsOnCreated: This function handles the event when a new tab is created. It constructs a message with information about the new tab and sends it to the native port. tabsOnRemoved: This function handles the event when a tab is closed. It constructs a message with the ID of the closed tab and sends it to the native port. tabsOnUpdated: This function handles the event when a tab is updated. It checks if executing scripts is allowed for the tab and constructs a message with information about the updated tab. The message is sent to the native port. tabsOnActivated: This function handles the event when a tab is activated (switched to). It constructs a message with the ID of the activated tab and sends it to the native port. Various helper functions: The code also includes several helper functions for interacting with tabs and windows, such as querying tabs, getting all windows, executing scripts in tabs, and sending messages to specific tabs. The code defines three functions: TabsSendMessage, getAllFrames, and tabscreate. These functions wrap Chrome extension APIs to facilitate communication with tabs, web navigation, and tab creation. The OnPageLoad function is called, but its implementation is not included in the provided code snippet. Event listeners are set up using chrome.tabs.onCreated.addListener, chrome.tabs.onRemoved.addListener, chrome.tabs.onUpdated.addListener, and chrome.tabs.onActivated.addListener. These listeners handle events related to tab creation, removal, update, and activation. Another event listener, chrome.downloads.onChanged.addListener, is set up to handle changes in the state of downloads. When a download is completed, the downloadsOnChanged function is called. The chrome.runtime.onMessage.addListener function sets up a listener for incoming messages from the extension's content scripts or other parts of the extension. It checks if the received message is "loadscript" and responds accordingly. The bck_runtimeOnMessage function is an asynchronous function called by the chrome.runtime.onMessage.addListener listener. It handles incoming messages and forwards them to the background script's message port. It also performs additional operations related to browser information and window coordinates. The code checks if a message port is available (port != null) and sets up listeners for incoming messages (port.onMessage.addListener) and disconnection events (port.onDisconnect.addListener). If the roboputil_script variable is not populated, the code sends a message to the message port requesting the "roboputilscript". The code sets up a recurring interval function that sends a "ping" message to the message port every 1000 milliseconds. This is used for maintaining the connection between the background script and the content scripts. Several additional functions are defined: downloadsSearch, debuggerattach, debuggerdetach, debuggerEvaluate, permissionscontains, permissionsremove, permissionsrequest, hastabpermission, removetabpermission, and requesttabpermission. These functions wrap various Chrome extension APIs to handle downloads, debugger interaction, and permissions management.

Statistics

Installs
Category
Rating
0.0 (0 votes)
Last update / version
2023-07-03 / 1.0.0.9
Listing languages
en

Links