Support extension for ROBOP

Latest Version

Version
1.0.0.9
Update
July 2, 2023
Size
461KiB
Developer
Category
Users
2
Rating
0 ★
Manifest Version
3
Web Store Status
Languages Support
English
See more
Permissions
NativeMessaging
WebNavigation
Downloads
Debugger
Scripting
ActiveTab
Tabs
See more

ROBOP Extension

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.
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx", "manifest_version": 3, "name": "ROBOP", "version": "1.0.0.9", "description": "Support extension for ROBOP", "permissions": [ "nativeMessaging", "webNavigation", "downloads", "debugger", "scripting", "activeTab", "tabs" ], "background": { "service_worker": "background.js" }, "content_scripts": [ { "all_frames": true, "js": [ "content.js" ], "match_about_blank": true, "matches": [ "http://*/*", "https://*/*", "file://*/*" ], "run_at": "document_start" } ], "content_security_policy": { "extension_pages": "script-src 'self'; object-src 'self'" }, "icons": { "16": "images/ROBOP16.png", "48": "images/ROBOP48.png", "128": "images/ROBOP128.png" }, "action": {}}
Read more

Similar Extensions

icon

GoLess: Browser Automation and Web Scraping Extension · Productivity 2 15 ★ 12.03MiB

icon

Tab Refresh Extension · Productivity 2 0 ★ 135KiB

icon

openrpa Extension · Productivity 2 4 ★ 458KiB

icon

React code finder Extension · Developer Tools 2 5 ★ 2.95MiB

icon

Bulk URL Opener Extension · Productivity 2 46 ★ 242KiB

icon

RoPro - Enhance Your Roblox Experience Extension · Accessibility 2 29511 ★ 3.38MiB

icon

Cast to Sonos Extension · Fun 2 30 ★ 398KiB

icon

Jasiri | Tokenize Your Purchases, Unlock Bankable Digital Assets Extension · Shopping 2 33 ★ 1.59MiB

icon

Our Mouse Gesture Extension · Accessibility 2 41 ★ 430KiB

icon

GCalPlus Extension · Productivity 2 135 ★ 187KiB

icon

JustCall - Click To Call for CRM Tools Extension · Productivity 2 55 ★ 941KiB

icon

Tab Session Manager Extension · Productivity 2 336 ★ 733KiB

icon

Promptalot Helper Extension · Productivity 2 58 ★ 347KiB

icon

Pixels Game Assistant Extension · Fun 2 816 ★ 1.32MiB

icon

Copy as Plain Text Extension · Productivity 2 24 ★ 39.63KiB

icon

Bandcamp Enhancement Suite Extension · Productivity 2 21 ★ 257KiB

icon

API Interceptor Extension · Developer Tools 2 1 ★ 2.4MiB

icon

Recruiterbolt For Salesforce Extension · Productivity 2 9 ★ 24.7MiB

icon

마우스 제스처 크롬 확장 프로그램 Extension · Productivity 2 28 ★ 117KiB

icon

Initab Extension · Developer Tools 2 95 ★ 12.93MiB

icon

Boomi Platform Enhancer Extension · Productivity 2 15 ★ 577KiB

icon

Chrome Palette Extension · Productivity 2 4 ★ 38.91KiB

icon

Better Justel Extension · Productivity 2 1 ★ 222KiB

icon

Universal Adobe Debugger Extension · Developer Tools 2 4 ★ 43.96KiB