-
-
Notifications
You must be signed in to change notification settings - Fork 189
Add Chrome browser event in database during recording #744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
1042fb5
add old chomre extension files
KrishPatel13 bcd647b
add old changes back, related to chrome extension, in openadapt dir
KrishPatel13 9c749ca
try web socket solution, add asyncio and websockets libraries to poetry
KrishPatel13 d9f9792
now we can log the dom changes ina a desctop running python process
KrishPatel13 fec777b
remove the old nativeMessaging extension code
KrishPatel13 9238316
rename dir
KrishPatel13 1b606fb
save the dom chages into dumy db: chrome.db
KrishPatel13 644a102
Merge branch 'main' into feat/chrome-extension
KrishPatel13 1246af4
try to fix actions tests
KrishPatel13 f782f5a
try 2 to fix actiosn
KrishPatel13 b1c9014
try 3 to fix github actions
KrishPatel13 a2126b1
ran `poetry run black --preview . --exclude 'alembic'`
KrishPatel13 86866b8
remove sockets.py
KrishPatel13 9d72328
fix falke8 formatting issues
KrishPatel13 b75d8ee
ran `poetry run black --preview . --exclude 'alembic'`
KrishPatel13 39e255a
Merge branch 'main' into feat/chrome-extension
KrishPatel13 205c433
add browser event code
KrishPatel13 31a5526
chrome extension work wip
KrishPatel13 3857dea
fix reset_db python file.
KrishPatel13 dc0f288
now, extension messages can be seen in logs when the recording is sta…
KrishPatel13 2abdd41
till trying to fix the issue: record functione execution gets stuck a…
KrishPatel13 da93ef5
browser_events can be seen in db
KrishPatel13 e8aff8a
ran black and flake8
KrishPatel13 c23ac7b
add documentation in extension side js files and remove unused files
KrishPatel13 b7eb18e
Merge branch 'main' into feat/chrome-extension
KrishPatel13 dffe40b
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#pullrequestreview-2…
KrishPatel13 32b6c8b
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668787418
KrishPatel13 dc5c699
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668782507
KrishPatel13 c06bb48
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668782930
KrishPatel13 fa9e458
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668785377
KrishPatel13 6643bc0
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668788679
KrishPatel13 8d187b0
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668788679
KrishPatel13 a73101d
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668790311
KrishPatel13 abaef76
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668791304
KrishPatel13 1bcc2ca
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668792409
KrishPatel13 c5f2495
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668793589
KrishPatel13 5dd341d
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668795476
KrishPatel13 6a3b74b
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668796268
KrishPatel13 9ca11a3
https://github.com/OpenAdaptAI/OpenAdapt/pull/744/files#r1668802201
KrishPatel13 bf5e43e
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668803476
KrishPatel13 3836c3d
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1668797431
KrishPatel13 ac65f13
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1676066028
KrishPatel13 392643d
update readme again
KrishPatel13 388156c
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1676066895
KrishPatel13 fe637f5
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1676069410
KrishPatel13 bb80c46
Update openadapt/models.py
KrishPatel13 98cdaa6
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1676071070
KrishPatel13 6154b2d
Merge branch 'feat/chrome-extension' of https://github.com/OpenAdaptA…
KrishPatel13 d82a77d
https://github.com/OpenAdaptAI/OpenAdapt/pull/744/files/3836c3d165bb1…
KrishPatel13 6c54099
ran black on openadapt dir
KrishPatel13 fbf7c77
Merge branch 'main' into feat/chrome-extension
KrishPatel13 e267384
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1676813676
KrishPatel13 20ce604
Merge branch 'feat/chrome-extension' of https://github.com/OpenAdaptA…
KrishPatel13 48af6c5
fran bklack
KrishPatel13 f0e0f2c
update the form type script
KrishPatel13 67528c1
add the record browser flag in classification group
KrishPatel13 aa7b1ae
Merge branch 'main' into feat/chrome-extension
abrichr f8a1216
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1691451352
KrishPatel13 ca55031
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1691417341
KrishPatel13 4323537
https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discussion_r1691424083
KrishPatel13 42bbf73
Update openadapt/config.py: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 ea89058
Update openadapt/record.py
KrishPatel13 64f20c3
Update openadapt/config.py: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 8e15ac9
Remove 3 unused functions owing to:
KrishPatel13 ba83cb9
Update openadapt/record.py: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 b9ef275
Rename owing to: https://github.com/OpenAdaptAI/OpenAdapt/pull/744#di…
KrishPatel13 eb1dd25
Merge branch 'feat/chrome-extension' of https://github.com/OpenAdaptA…
KrishPatel13 af181d1
Rename const: https://github.com/OpenAdaptAI/OpenAdapt/pull/744#discu…
KrishPatel13 995fc55
Remove unused: https://github.com/OpenAdaptAI/OpenAdapt/pull/744#disc…
KrishPatel13 96b415b
Use ClassVar again: https://github.com/OpenAdaptAI/OpenAdapt/pull/744…
KrishPatel13 c75e499
Update openadapt/models.py: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 c5d7e76
Update openadapt/record.py: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 6d2babd
Update openadapt/record.py: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 fad4143
Move string to const: https://github.com/OpenAdaptAI/OpenAdapt/pull/7…
KrishPatel13 0162cc8
Merge branch 'feat/chrome-extension' of https://github.com/OpenAdaptA…
KrishPatel13 b00ae8a
Correct Grammatical errors: https://github.com/OpenAdaptAI/OpenAdapt/…
KrishPatel13 b3d54eb
fix visualize and reformat
KrishPatel13 0347b3d
fix alembic migrations
abrichr 7905a2c
Intersection/MutationObserver; _repr_ignore_attrs; fix process_events
abrichr 1a3fde9
synchronize timestamps
abrichr 329702b
attachWindowEventListeners
abrichr 6571476
recreate alembic migration
abrichr 798c806
sync; buffer
abrichr 602f85c
add dtw.py (wip)
abrichr 925db61
remove sorting and syncing; working experiments/dtw.py
abrichr 3bcf036
fix content.js
abrichr 2959293
report screenX/screenY; fix getScreenCoordinates; compute coordinate …
abrichr 874c1ce
wip
abrichr 2d62d5d
remove observers; composite distance; task_by_name
abrichr 4c33af9
replace eventBuffer with coordMappings; compute tlbr-screen in browse…
abrichr 4b9582e
assign_browser_events in events.py
abrichr dd1be17
merge to master
abrichr 67c0cc4
black; docstrings
abrichr 962549e
flake8
abrichr 05410f9
update test
abrichr e40870a
black
abrichr 8452b8b
add test_browser.py
abrichr b265a62
fix README grammar
abrichr 0df8cc2
remove record.run_main
abrichr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* @file background.js | ||
* @description Creates a new background script that listens for messages from the content script | ||
* and sends them to a WebSocket server. | ||
*/ | ||
|
||
let socket; | ||
let timeOffset = 0; // Global variable to store the time offset | ||
|
||
/* | ||
* TODO: | ||
* Ideally we read `WS_SERVER_PORT`, `WS_SERVER_ADDRESS` and | ||
* `RECONNECT_TIMEOUT_INTERVAL` from config.py, | ||
* or it gets passed in somehow. | ||
*/ | ||
let RECONNECT_TIMEOUT_INTERVAL = 1000; // ms | ||
let WS_SERVER_PORT = 8765; | ||
let WS_SERVER_ADDRESS = "localhost"; | ||
let WS_SERVER_URL = "ws://" + WS_SERVER_ADDRESS + ":" + WS_SERVER_PORT; | ||
|
||
|
||
function socketSend(socket, message) { | ||
console.log({ message }); | ||
socket.send(JSON.stringify(message)); | ||
} | ||
|
||
|
||
/* | ||
* Function to connect to the WebSocket server. | ||
*/ | ||
function connectWebSocket() { | ||
socket = new WebSocket(WS_SERVER_URL); | ||
|
||
socket.onopen = function() { | ||
console.log("WebSocket connection established"); | ||
}; | ||
|
||
socket.onmessage = function(event) { | ||
console.log("Message from server:", event.data); | ||
const message = JSON.parse(event.data); | ||
}; | ||
|
||
socket.onclose = function(event) { | ||
console.log("WebSocket connection closed", event); | ||
// Reconnect after 5 seconds if the connection is lost | ||
setTimeout(connectWebSocket, RECONNECT_TIMEOUT_INTERVAL); | ||
}; | ||
|
||
socket.onerror = function(error) { | ||
console.error("WebSocket error:", error); | ||
socket.close(); | ||
}; | ||
} | ||
|
||
// Create a connection to the WebSocket server | ||
connectWebSocket(); | ||
|
||
/* Listen for messages from the content script */ | ||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { | ||
const tabId = sender.tab.id; | ||
message.tabId = tabId; | ||
if (socket && socket.readyState === WebSocket.OPEN) { | ||
socketSend(socket, message); | ||
sendResponse({ status: "Message sent to WebSocket" }); | ||
} else { | ||
sendResponse({ status: "WebSocket connection not open" }); | ||
} | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.