Skip to content
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

Changes made inside external editor are not picked up? #18

Open
Mrnofish opened this issue Jul 14, 2021 · 13 comments
Open

Changes made inside external editor are not picked up? #18

Mrnofish opened this issue Jul 14, 2021 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@Mrnofish
Copy link

Hey there,

I set up TamperDAV according to instructions, and now clicking on the cloud icon opens the script in the external editor.

However, whatever change I make externally, isn't picked up by TamperMonkey. More, a test change that I made yesterday in the editor was lost as seemingly TamperDAV sync'ed the file from TamperMonkey and overwrote the one in the sync directory.

Whenever I click on the cloud icon, Firefox opens a new tab pointing at http://localhost:7000/Tampermonkey/sync/[UUID].user.js?method=editor#bypass=true showing the following error: Problem loading page - The address wasn't understood.

The file is opened in the editor nonetheless.

Anybody can help please?

@derjanb
Copy link
Member

derjanb commented Jul 15, 2021

  1. Are you sure TamperDAV is already running when Tampermonkey is started? Please close Firefox, wait some seconds as background processes might need some time to exit. Then start TamperDAV and after this Firefox again.

  2. How do you start TamperDAV? Are you sure the "meta-touch" option is set?

@derjanb derjanb added the help wanted Extra attention is needed label Jul 15, 2021
@Mrnofish
Copy link
Author

Mrnofish commented Jul 15, 2021

Thanks for the prompt reply.

Yes to all of your questions. I repeated all the steps just in case, making sure all Firefox processes were no longer visible in the Task Manager, still not seeing any improvement.

Every time I add a line in the external editor, and save, Tampermonkey prints:

Sync is running
1 change(s) imported
Sync is finished

So it does look like it should be working; however, if I open the userscript inside Tampermonkey, none of the changes is there.

How do you start TamperDAV?

From inside a command prompt, using the batch file from the package. (Forgot to mention that I'm on Windows).

BTW since I switched the Sync setting to WebDAV, all of my 'last updated' states have been reset, so scripts that haven't been modified now show July, 13, as their time of last modification.

@Mrnofish
Copy link
Author

PS: when first setting up TamperDAV I changed open-in-editor to point towards my editor of choice.

However, backslashes did not work (I thought this was covered by the upath module in Node.js ?) and I had to change them to forward slashes, as if a Unix path, e.g. d:/apps/myeditor/myeditor.exe

Is this the correct way to configure the external editor under Windows?

@derjanb
Copy link
Member

derjanb commented Jul 15, 2021

However, backslashes did not work (I thought this was covered by the upath module in Node.js ?)

I need to test it at Windows again... Or you can file a pull request if you found a working solution...

however, if I open the userscript inside Tampermonkey, none of the changes is there.

What is your Tampermonkey version?

@Mrnofish
Copy link
Author

Or you can file a pull request if you found a working solution...

I wish I could be of more help, however I'm not at all familiar with Node.js: I looked into upath because Node was complaining about upath while I was installing TamperDAV, afterwards it transpired Node needed to be whitelisted in the firewall to download from the Internet, and there was nothing wrong with upath or Node themselves.

What I can say, is that both forward slashes and escape backward slashes 'work' meaning that TamperDAV accepts both without throwing an error at runtime, regardless I'm getting that "Problem loading" in Firefox that I mentioned previously.

Using backwards slashes alone isn't accepted, though.

What is your Tampermonkey version?

4.13.6136.

In case this helps, after pressing the Restart Tampermonkey button in the Settings page, Tampermonkey will show the changed file in the internal editor.

I would have to restart Tampermonkey after every change, though.

@MarvinXu
Copy link

Same problem here. After editing script in external editor, I have to click Tampermonkey browser extension menu: utilities -> check for userscript updates to make it update...

@mike2003
Copy link

I have a problem too. Files after editing are not synchronized. And there is no point in using this server. But if I add a new script to FF, it gets into the directory quickly. But it doesn't work the other way. And even manual start does not work.

@jh34ghu43gu
Copy link

jh34ghu43gu commented Mar 7, 2023

In tampermonkey config make sure that the update interval in the Externals settings is set to always.
image

If this is set to never it doesn't work. I had to restart after changing the setting for it to take effect.

Edit: nvm it stopped automatically checking after a short while.
Edit2: My solution was to create a dummy script that @require http://localhost:7000/Tampermonkey/sync/local.js
Changes are registered on the 2nd page refresh after a few seconds from brief testing, and requires not having a username/password on the dav server.

@Malix-Labs
Copy link

What stops this issue from being closed?

@Mrnofish
Copy link
Author

...providing a workaround that may not work well or at all, is different from fixing a problem?

@x-yuri
Copy link

x-yuri commented Jul 1, 2023

I guess after changing Tampermonkey settings (sync/webdav) you need to restart the browser. I thought that Update Interval made it work, but it now works with Update Interval == Never.

When you change a file 2 messages should appear in the extension tab (at the top):

And when you open the file in Tampermonkey:

the change should be there.

Also I believe General/Config mode == Beginner should be enough.

I'm running Arch Linux.

Considering this (if still relevant):

Every time I add a line in the external editor, and save, Tampermonkey prints:

Sync is running
1 change(s) imported
Sync is finished

So it does look like it should be working; however, if I open the userscript inside Tampermonkey, none of the changes is there.

the OP has a different issue.

@x-yuri
Copy link

x-yuri commented Aug 4, 2023

@derjanb What does it mean if after changing a file TamperDAV says only (no more output):

Aug 04 22:44:05 yuri tamperdav.sh[676]: metatouch: dav/Tampermonkey/sync/71faee81-99cd-4f76-a9cf-3f34bb77819f.meta.json

Usually this line is followed by some communication that transmits the file to Tampermonkey.

@pom3333
Copy link

pom3333 commented Sep 20, 2023

Try replacing the code below.

[ server.js: 223 ]
response.setHeader('Location', dav://${request.headers.host}${uri.pathname});

replace it with

response.write(`<meta http-equiv=Refresh content=0;URL="http://${request.headers.host}${uri.pathname}" />`)
response.write("<script>setTimeout(window.close,2000)</script>")

http://localhost:7000/Tampermonkey/sync/[UUID].user.js?method=editor#bypass=true showing the following error: Problem loading page - The address wasn't understood.

It works in firefox but installation is refused in chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants