kylepaulsen / ResourceOverride

An extension to help you gain full control of any website by redirecting traffic, replacing, editing, or inserting new content.
MIT License
467 stars 117 forks source link

Invalid response mime type #18

Closed orty closed 6 years ago

orty commented 6 years ago

Hello,

First, thanks for this amazing extension, I use it every single day in my web development tasks at work :).

I think there might be a bug though, now when I select HTML as the file type in a URL -> File resource overriding, the response mime type is set to CSS, and when I go back to my rule it is set to 'CSS' instead of 'HTML' as well.

Best regards.

kylepaulsen commented 6 years ago

By chance are you talking about the syntax dropdown in the editor? I think the algorithm for detecting the syntax is primitive, so I probably wouldn't expect that to be super accurate. However, if you actually do get an error with mime type, you can force the mime type of your code with a special comment on the very first line:

/ mime: text/html /

If the extension sees the first line looks like that, it will remove it from the document and then force that mime. The help section mentions this near the bottom.

orty commented 6 years ago

Thanks for giving me that trick 🤗 I'll give it a shot and keep you posted if I encounter any further issue