mwoffliner icon indicating copy to clipboard operation
mwoffliner copied to clipboard

unnecessary images loaded from wikimedia

Open ghost opened this issue 4 years ago • 13 comments

@ghost commented on Oct 7, 2020, 7:20 PM UTC:

When I use kiwix-serve on Windows and open any article, I noticed in network monitor or via umatrix that upload.wikimedia.org two images are being loaded, which even if I let them to download, do not appear in article ever, meaning they are useless: https://upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg https://upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg

This issue was moved by kelson42 from kiwix/kiwix-desktop#529.

ghost avatar Oct 18 '20 18:10 ghost

@kelson42 commented on Oct 8, 2020, 5:31 AM UTC:

@NijazM which content is that exactly?

ghost avatar Oct 18 '20 18:10 ghost

@ghost commented on Oct 8, 2020, 9:20 PM UTC:

wikipedia_en_all_maxi_2020-07.zim

ghost avatar Oct 18 '20 18:10 ghost

We need to clarify an d then understand why these ones are not rewritten.

kelson42 avatar Oct 18 '20 18:10 kelson42

@ghost can you please tell which articles were you opening when you saw this problem.

MananJethwani avatar Oct 21 '20 05:10 MananJethwani

@MananJethwani I recently discovered that if you see an account "ghost" it means the user has deleted their account, so presumably will no longer receive pings...

Jaifroid avatar Oct 21 '20 07:10 Jaifroid

I confirm the problem. It comes from res/inserted_style.css. All that file should be removed as this should come from the online version.

kelson42 avatar Oct 23 '20 14:10 kelson42

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Dec 23 '20 03:12 stale[bot]

Why is this issue staled? For all max 2021.3, most page contains external link which cause Chrome waiting 20 seconds to fail it.

zkosk avatar Aug 26 '21 03:08 zkosk

@zkosk Because we didn't have had the time to do it. This is that simple.

kelson42 avatar Aug 26 '21 07:08 kelson42

@kelson42 I don't know how the offliner work, maybe adding some code that replace all external links with some builtin resources?

zkosk avatar Aug 31 '21 02:08 zkosk

@kelson42 The code is like:

<style data-mw-deduplicate="TemplateStyles:r982806391"> ... url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg") ... </style>

What about build some filter framework into kiwix-serve project, then adding a filter that remove the url or change it to local resource in kiwix-serve.exe can solve any such problems. All the operations are done on the fly when the pages are served by kiwix-serve, having nothing todo with the off-liner which seems to be hard to modify and debug. This also provide the opportunity to improve the experience at any time without waiting for a new version of the zim. The filter can be even configured through config text files then any user can add filter at anytime.

zkosk avatar Sep 15 '21 00:09 zkosk

@zkosk The problem is that these files are part of js/css modules and the way how these modules are handled is buggy. The problem is larger than this ticket. I have put the ticket here to fix it here as this is a bug in MWoffliner, nothing to do with Kiwix Serve.

kelson42 avatar Sep 15 '21 06:09 kelson42

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Mar 02 '22 08:03 stale[bot]

kiwix-serve meanwhile forbids to external resources

kelson42 avatar Apr 05 '23 13:04 kelson42