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

Allow arbitrary rules of all circumstances #79

Closed
sjehuda opened this issue Jul 2, 2023 · 3 comments
Closed

Allow arbitrary rules of all circumstances #79

sjehuda opened this issue Jul 2, 2023 · 3 comments

Comments

@sjehuda
Copy link

sjehuda commented Jul 2, 2023

The following set of rules won't have any effect on application/xml and text/xml because both are opened in browser.

The rules will work for application/atom+xml, application/rss+xml etc.

{
  "mime-mappings": {
    "application/atom+xml": "1text/plain",
    "application/rss+xml": "1text/plain",
    "application/rdf+xml": "1text/plain",
    "application/feed+json": "1text/plain",
    "application/x-atom+xml": "1text/plain",
    "application/x-rss+xml": "1text/plain",
    "application/x-rdf+xml": "1text/plain",
    "application/xml": "1text/plain",
    "text/xml": "1text/plain"
  },
  "sniffed-mime-mappings": {},
  "text-nosniff": false,
  "octet-sniff-mime": true,
  "override-download-type": false
}

Please allow setting arbitrary content-type, even to content-types that already are opened in browser.

I need this feature in order for my program to work. See greasemonkey/greasemonkey#3164 (comment)

@Rob--W
Copy link
Owner

Rob--W commented Jul 2, 2023

This is borderline out of scope for the extension. The purpose of the extension is to allow users to view content that can potentially be displayed inline but somehow is not. What you are effectively doing is to convert something that can already be displayed inline, to an alternative that does not correctly render the content.

Based on your comment + error message at greasemonkey/greasemonkey#3164 (comment), it looks like you are mainly looking for a work-around for your user script to work around the stricter parser requirements in XML documents. Instead of that, I suggest to convert your input to well-formed X(HT)ML (e.g. using the DOMParser API with type text/html) and then append the result (which should now be accepted by the document because serializing the result again produces well-formed markup).

For documentation on DOMParser, see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser.

@sjehuda
Copy link
Author

sjehuda commented Jul 3, 2023 via email

@Rob--W Rob--W closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
@sjehuda
Copy link
Author

sjehuda commented Jul 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants