Bug 467459 - Greasemonkey doesn't check content type
Summary: Greasemonkey doesn't check content type
Status: RESOLVED FIXED
Alias: None
Product: Falkon
Classification: Applications
Component: extensions (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-16 20:18 UTC by Schimon Jehudah
Modified: 2024-11-06 19:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Schimon Jehudah 2023-03-16 20:18:35 UTC
It appears that Greasemonkey doesn't check content type.
When Greasemonkey is enabled, navigating to the following link (HTML filetype) won't be possible.
https://github.com/glitsj16/firejail-handler-extra/blob/master/fjyt.user.js
Comment 1 Juraj 2023-06-10 13:27:38 UTC
Greasemonkey only checks the URL.
If it ends with "user.js" it is regarded as userscript and should b e installed and hidden from user.

My proposed solutions are to:
- always allow loading the userscript code (user will always see it).
- Adapt the GreaseMonkey code to detect if the file is a proper userscript or not.
OR
- When the "user.js" is detected in URL try to download it and based on results allow to display the file in browser.
Comment 2 Rory 2024-02-23 05:10:38 UTC
(In reply to Schimon Jehudah from comment #0)
> It appears that Greasemonkey doesn't check content type.
> When Greasemonkey is enabled, navigating to the following link (HTML
> filetype) won't be possible.
> https://github.com/glitsj16/firejail-handler-extra/blob/master/fjyt.user.js

If you install GM on FF it also opens that page normally.  To trigger the install click 'raw' button on the upper right of the code box.
Comment 3 Bug Janitor Service 2024-10-26 06:08:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/falkon/-/merge_requests/90
Comment 4 Juraj 2024-11-06 19:13:51 UTC
Git commit 4772efb483473f2a1f0f4268589bfe9a6002838d by Juraj Oravec.
Committed on 06/11/2024 at 19:10.
Pushed by jurajo into branch 'master'.

GreaseMonkey - Check content type of url *.user.js

- Do not stop loading the page with url matching user script
- Only match clicked links

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>

M  +7    -0    src/plugins/GreaseMonkey/gm_downloader.cpp
M  +2    -3    src/plugins/GreaseMonkey/gm_plugin.cpp

https://invent.kde.org/network/falkon/-/commit/4772efb483473f2a1f0f4268589bfe9a6002838d