Skip to content

[Question] Match by header (e.g. content-type) #252

@sjehuda

Description

@sjehuda

Hello,

I want to open Web Feeds inside browser.

This is the set of rules:

{
  "request": [],
  "sendHeader": [],
  "receiveHeader": [
    {
      "enable": true,
      "name": "XML",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "Atom Syndication",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/atom\\+xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "RSS Feed",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/rss\\+xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "X-Atom",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/x-atom\\+xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "X-RSS",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/x-rss\\+xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "JSON Feed",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/feed\\+json",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "X-RDF",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/x-rdf\\+xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    },
    {
      "enable": true,
      "name": "RDF Vocabulary",
      "ruleType": "modifyReceiveHeader",
      "matchType": "regexp",
      "pattern": "application/rdf\\+xml",
      "exclude": "",
      "group": "Web Feeds",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      }
    }
  ],
  "receiveBody": []
}

None of the rules work because there is no instruction of content-type.

This single rule does work, but it interrupts HTML web pages (Same for text/html which would render HTML but skip CSS and maybe JS too; I didn't check the latter).

{
  "request": [],
  "sendHeader": [],
  "receiveHeader": [
    {
      "enable": true,
      "name": "Set Content Type Plain Text",
      "ruleType": "modifyReceiveHeader",
      "matchType": "all",
      "pattern": "",
      "exclude": "",
      "group": "Streamburner",
      "isFunction": false,
      "action": {
        "name": "content-type",
        "value": "text/plain"
      },
      "code": ""
    }
  ],
  "receiveBody": []
}

The following rules are working and are of Open in Browser addon:

{
  "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"
  },
  "sniffed-mime-mappings": {},
  "text-nosniff": false,
  "octet-sniff-mime": true,
  "override-download-type": false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions