Bug 1586188 - Import WebCompat GoFaster 6.2.0 sources; r=miketaylr

Differential Revision: https://phabricator.services.mozilla.com/D48152

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ksenia Berezina 2019-10-04 14:25:21 +00:00
parent 93067a6541
commit f7866258a3
8 changed files with 64 additions and 12 deletions

View File

@ -203,16 +203,20 @@ const AVAILABLE_INJECTIONS = [
{
id: "bug1577870",
platform: "desktop",
domain: "slideshare.net",
domain: "Download prompt for files with no content-type",
bug: "1577870",
data: {
urls: ["https://*.linkedin.com/tscp-serving/dtag*"],
urls: [
"https://*.linkedin.com/tscp-serving/dtag*",
"https://ads-us.rd.linksynergy.com/as.php*",
"https://www.office.com/logout?sid*",
],
contentType: {
name: "content-type",
value: "text/html; charset=utf-8",
},
},
customFunc: "dtagFix",
customFunc: "noSniffFix",
},
{
id: "bug1305028",

View File

@ -145,6 +145,28 @@ const AVAILABLE_UA_OVERRIDES = [
},
},
},
{
/*
* Bug 1582582 - sling.com - UA override for sling.com
* WebCompat issue #17804 - https://webcompat.com/issues/17804
*
* sling.com blocks Firefox users showing unsupported browser message.
* When spoofing as Chrome playing content works fine
*/
id: "bug1582582",
platform: "desktop",
domain: "sling.com",
bug: "1582582",
config: {
matches: ["https://watch.sling.com/*", "https://www.sling.com/*"],
uaTransformer: originalUA => {
return (
UAHelpers.getPrefix(originalUA) +
" AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
);
},
},
},
{
/*
* Bug 1480710 - m.imgur.com - Build UA override

View File

@ -36,7 +36,7 @@ const replaceStringInRequest = (
};
const CUSTOM_FUNCTIONS = {
dtagFix: injection => {
noSniffFix: injection => {
const { urls, contentType } = injection.data;
const listener = (injection.data.listener = e => {
e.responseHeaders.push(contentType);
@ -48,7 +48,7 @@ const CUSTOM_FUNCTIONS = {
"responseHeaders",
]);
},
dtagFixDisable: injection => {
noSniffFixDisable: injection => {
const { listener } = injection.data;
browser.webRequest.onHeadersReceived.removeListener(listener);
delete injection.data.listener;

View File

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Web Compat",
"description": "Urgent post-release fixes for web compatibility.",
"version": "6.1.0",
"version": "6.2.0",
"applications": {
"gecko": {

View File

@ -203,16 +203,20 @@ const AVAILABLE_INJECTIONS = [
{
id: "bug1577870",
platform: "desktop",
domain: "slideshare.net",
domain: "Download prompt for files with no content-type",
bug: "1577870",
data: {
urls: ["https://*.linkedin.com/tscp-serving/dtag*"],
urls: [
"https://*.linkedin.com/tscp-serving/dtag*",
"https://ads-us.rd.linksynergy.com/as.php*",
"https://www.office.com/logout?sid*",
],
contentType: {
name: "content-type",
value: "text/html; charset=utf-8",
},
},
customFunc: "dtagFix",
customFunc: "noSniffFix",
},
{
id: "bug1305028",

View File

@ -145,6 +145,28 @@ const AVAILABLE_UA_OVERRIDES = [
},
},
},
{
/*
* Bug 1582582 - sling.com - UA override for sling.com
* WebCompat issue #17804 - https://webcompat.com/issues/17804
*
* sling.com blocks Firefox users showing unsupported browser message.
* When spoofing as Chrome playing content works fine
*/
id: "bug1582582",
platform: "desktop",
domain: "sling.com",
bug: "1582582",
config: {
matches: ["https://watch.sling.com/*", "https://www.sling.com/*"],
uaTransformer: originalUA => {
return (
UAHelpers.getPrefix(originalUA) +
" AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
);
},
},
},
{
/*
* Bug 1480710 - m.imgur.com - Build UA override

View File

@ -36,7 +36,7 @@ const replaceStringInRequest = (
};
const CUSTOM_FUNCTIONS = {
dtagFix: injection => {
noSniffFix: injection => {
const { urls, contentType } = injection.data;
const listener = (injection.data.listener = e => {
e.responseHeaders.push(contentType);
@ -48,7 +48,7 @@ const CUSTOM_FUNCTIONS = {
"responseHeaders",
]);
},
dtagFixDisable: injection => {
noSniffFixDisable: injection => {
const { listener } = injection.data;
browser.webRequest.onHeadersReceived.removeListener(listener);
delete injection.data.listener;

View File

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Web Compat",
"description": "Urgent post-release fixes for web compatibility.",
"version": "6.1.0",
"version": "6.2.0",
"applications": {
"gecko": {