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

TWC file contaminated somewhat #27

Open
PengjuYan opened this issue Jul 20, 2019 · 15 comments
Open

TWC file contaminated somewhat #27

PengjuYan opened this issue Jul 20, 2019 · 15 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@PengjuYan
Copy link

Thank you @YakovL and @ibnishak for making Timimi and making it work for TiddlyWiki classic (#23).

Though, there're some problems in the resulting TWC file what the previous plugins (although they don't work any more) won't produce. In short, the original clean TWC file is "contaminated" somewhat. Although it doesn't block TWC or Timimi from working, it's still better if we keep the file content to be original.

If you compare the original clean TWC file and a updated file saved by Timimi, you will see 3 unwanted differences (other than the <storeArea>):

  1. The <title> element is filled in with "My TiddlyWiki - a reusable ...".
  2. The name of injected patch-classic-io.js appears in <head>.
  3. The injected tiddlyfox-message-box <div> appears at the end of <body>.
@YakovL
Copy link
Contributor

YakovL commented Jul 20, 2019

Hi, could you specify the version of TWC you are using? I've tested the latest version of Timimi (modified in dev mode) with 2.9.2 and the message box is removed there, so it's essential to get a way to reproduce the issue to fix it

@PengjuYan
Copy link
Author

I tested by using a freshly downloaded (just downloaded before I did the test) 2.9.2 version. And my FireFox version is 68.0.1 on macOS.

(Just a reminder: As I mentioned in #23, it's possible that "FireFox + approved add-on" and "web-ext FireFox + you local add-on" may behave differently.)

@YakovL
Copy link
Contributor

YakovL commented Jul 20, 2019

Ok, thanks for reporting. Unfortunatelly I probably won't be able to test and start debugging this until Monday; could you test whether the "contamination" is cumulative or not? (open TW, edit, save, reload TW, edit and save again: are those bits added only once or some are added twice?)

@PengjuYan
Copy link
Author

Not cumulative. Just added only once.

@ibnishak ibnishak added the help wanted Extra attention is needed label Jul 21, 2019
@ibnishak
Copy link
Owner

@YakovL : May I assign this issue to you?

@YakovL
Copy link
Contributor

YakovL commented Jul 23, 2019

@ibnishak yeap, no problem

@ibnishak ibnishak assigned ibnishak and YakovL and unassigned ibnishak Jul 26, 2019
@YakovL
Copy link
Contributor

YakovL commented Aug 28, 2019

Hi @PengjuYan , could you check whether your FireFox has (in about:config) security.fileuri.strict_origin_policy disabled? I suspect that disabling it will stop contaminating (although won't undo it so you probably need to do that manually)

@PengjuYan
Copy link
Author

PengjuYan commented Aug 29, 2019

Hi @YakovL , I tested by switching security.fileuri.strict_origin_policy from default true to false back and forth, and found that the "contaminating" disappears!

In concrete:

  1. Still there: The <title> element is filled in with "My TiddlyWiki - a reusable ...". This is benign.
  2. Disappeared: The name of injected patch-classic-io.js appears in <head>.
  3. Disappeared: The injected tiddlyfox-message-box <div> appears at the end of <body>.

In other words, the value of security.fileuri.strict_origin_policy doesn't effect the phenomenon. The problem has been fixed automatically (possibly by FireFox 68.0.2 ?).

My settings include:

  1. I'm now using FireFox version 68.0.2 on macOS instead of 68.0.1.
  2. TiddlyWiki classic version 2.9.2 unchanged.
  3. Timimi version 2.0.3 (I'm not sure about the Timimi version when I report this issue, my bad).

Shall I close this issue?

@pmario
Copy link

pmario commented Sep 3, 2019

@PengjuYan
Copy link
Author

@pmario Thank you Mario for pointing me to the discussion there. According to @pmario and @YakovL, seems like the problem lies in recreateOriginal and @pmario solved it in his amazing file-backups (back in 2017 when I was using file-backups I suffered the same problem and I switched to savetiddlers 0.6).

Is there any plan to fix this issue in Timimi for TWC?

I just reproduced this issue by using TWC 2.9.2 + Firefox 75.0 + macOS Catalina (10.15.4) once again.

@ibnishak
Copy link
Owner

ibnishak commented May 5, 2020

Will look into it for the next upgrade.

@YakovL
Copy link
Contributor

YakovL commented May 7, 2020

Couple of notes:

  1. (regarding title) this is actually the expected behavior, title is calced in accord to SiteTitle and SiteSubtitle on saving, this is not a contamination. Well, may be this needs retesting ("My TiddlyWiki - a reusable ..." is in accord to initial SiteTitle and SiteSubtitle values, but it should always be from the current values when they are different from initial ones)
  2. to be retested, the patch-classic-io.js script is expected to be removed from the head. If it is not, it should be investigated and fixed; in Chrome it will be removed slightly differently
  3. tiddlyfox-message-box is something that needs a closer look. First, it should probably be removed in recreateOriginal by TWC core (see backward compatibility notes by Mario in the thread he referenced). Second, I'm not sure if browser extensions should do anything about it. Chrome is very restrictive about XHRs via file:// scheme. Actually, the best approach would be to support file loading functionality by Timimi (backend and extension), but this is not yet something where I can contribute

@PengjuYan
Copy link
Author

Hi @ibnishak and @YakovL , is there any plan to investigate the issue?

My TWC file keeps add patch-classic-io.js to the <head> section. I will have to open the .html file and clean it manually time by time after many patch-classic-io.js accumulated.

Reproduction environment:

Software Version
TiddlyWiki Classic 2.10.0
Firefox 122.0.1 (64-bit)
macOS 13.0.1

Reproduction result:

  1. Save TWC, then
    1.1. A <div> id=tiddlyfox-message-box appears at the end of <body>.
    1.2. A <script> with src=patch-classic-io.js appears at the end of <head>.
  2. Save once again, then nothing changes;
  3. Reload the TWC file and save again, then
    3.1. Another <script> with src=patch-classic-io.js appears at the end of <head>.

That is to say, the <script> with src=patch-classic-io.js will be accumulated in the TWC file whenever you save it after a reload.

@YakovL
Copy link
Contributor

YakovL commented Feb 15, 2024

Hi Pengju, well it wasn't planned before (or rather was somethere in the middle of my big backlog(s)), but may be I'll take a look for the next release. I've created a TW issue: TiddlyWiki/TiddlyWikiClassic#308; but may be I'll propose a Timimi update as well

@PengjuYan
Copy link
Author

Hi @YakovL , thought you guys have a lot of things to do. Just to remind and hope you put it on the agenda. Never mind and take your time. :-)

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

4 participants