-
Notifications
You must be signed in to change notification settings - Fork 5
Remote editor support #11
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
base: main
Are you sure you want to change the base?
Conversation
In my case, I just have terrible issues trying to install node 18.
The basic workflow is: 1. Open editor with companion extension. 2. Get the code from editor. 3. Open extension popup and paste the code. 4. Use connection to edit files. UX and UI needs work but the basic functionality and communication protocol should be good enough like this.
1df4807 to
cbe6b5a
Compare
| action.onClicked.addListener(async (_details) => { | ||
| void(runtime.lastError); | ||
| const openOnlineEditor = async () => { | ||
| hhp = hhp || await hasHostPermission(MAIN_URL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary if you lock in this handler like it done here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handleMessage lock was a nightmare for me. I had to disable it to be able to figure out how to call Tampermonkey API. Even with the types you guided me, I lost so many messages which were just ignored/dumped.
The worst part of a lock is when there's no guarantee that the lock will unlock when the execution leaves the block. I wanted to try fixing that but it's too hard without knowing exactly how to make sure the lock unlocks and we don't get a non-responding extension when the user clicks too much.
I have the code like that because that's how you had your code before. I just moved some details around to stay like that.
So you think a lock should be used for that one too?
|
Sorry for the late review. I was very busy lately. |
|
It's ok. You still did when you were able to. |
|
@derjanb Sorry about the delay. I finally got some time and did the work of applying types to variables. Is how I did good enough? |
95dfd45 to
998760a
Compare
|
I'm also interested in this, is there something I can do to help? |
|
@jubr Sure. Try it out, review the changes and give feedback. I was busy recently, but will do the same, so that we can continue with this. |
|
@brunoais Always feel free to ping me, in case my response takes too long... 🙈 |
|
I'm trying to fire this up, but it looks like the "Open extension popup and paste the code." does not show up for me in the newly started VSCode instance. I do see the new tab "Tampermonkeyfs" under explorer there. Perhaps my experience with VSCode plugins is lacking... but also the documentation is kind of sparse... I already:
When I could not get it to work I checked this works (and it does):
I'm suspecting it might have something to do with the That does not change anything in background.js. I've tried with both vanilla VSCode and Cursor - the latter being the real reason I'm looking into this 😜 any ideas? |
|
|
|
yes, so I should add my custom one after |
Yes, replace or add. this doesn't matter. This code prevents Tampermonkey from talking to "unverified" Tampermonkey Editor extensions. |
|
yeah makes sense.. can it be that id is no longer in the latest release? |
No, it's there. Did you run |
|
Cool, that takes care of Tampermonkey <-> Tampermonkey Editors. Now to get it hooked up to |
|
Now it's back to only one error: A quick fix 😋 |
|
Yup, build suc6. Now firing it up.... |
|
Note to self: clean up namespaces in my scripts 🙃 And now let's see if this speeds up my workflow with Cursor.... 🤞 |
|
Activity summons me. In my case, I use firefox, so don't run that Given the large list of type errors, @jubr , if you know how to deal with typescript types, you are welcome to help. I'm a complete beginner with Typescript typing system. @jubr, if you may, I'd like feedback about the implementation on vscode side (not here but in its repo). I know about many issues with the extension but I want to know about potential fixes or alternative ways of solving its issues. |
I pinged you but I didn't insist because I didn't want to repeat the ping assuming that you couldn't come and you'd eventually come. I'll ping you about once a month when you don't respond, then. |



The basic workflow is:
UX and UI needs work but the basic functionality and communication protocol should be good enough like this.
I'm creating this PR because I think it's ready for some initial review.
I'm expecting to create the repository and upload the example vscode extension in a few hours.
@derjanb Please do an initial review
The vscode extension can be found here: https://gitlab.com/brunoais/tampermonkey-vscode
resolves #10