Loading browser/components/search/test/browser/browser_addSearchEngineFromForm.js +4 −24 Original line number Diff line number Diff line Loading @@ -27,18 +27,6 @@ const TESTS = [ submission: "kitten", expected: "https://example.org/search?q=kitten&utf8%E2%9C%93=%E2%9C%93", }, { action: "/search", method: "POST", charset: "UTF-8", fields: [ { name: "q", value: "Some initial value", main: true }, { name: "utf8✓", value: "✓", hidden: true }, ], submission: "kitten", expected: "https://example.org/search", expectedPost: "q=kitten&utf8%E2%9C%93=%E2%9C%93", }, { action: "/search", method: "GET", Loading @@ -51,18 +39,6 @@ const TESTS = [ submission: "caff\u00E8+", expected: "https://example.org/search?q=caff%E8%2B&cb=true", }, { action: "/search", method: "POST", charset: "windows-1252", fields: [ { name: "q", main: true }, { name: "foo", value: "bar" }, ], submission: "caff\u00E8+", expected: "https://example.org/search", expectedPost: "q=caff%E8%2B&foo=bar", }, ]; const URL_UTF_8 = Loading Loading @@ -249,6 +225,10 @@ add_task(async function testSearchFieldDetection() { Assert.equal(isSearchField, false, "Method=dialog means no search field"); form.method = "POST"; isSearchField = SpellCheckHelper.isTargetASearchEngineField(input, window); Assert.equal(isSearchField, false, "Method=post means no search field"); form.method = "GET"; delete input.removeAttribute("name"); isSearchField = SpellCheckHelper.isTargetASearchEngineField(input, window); Loading toolkit/modules/InlineSpellChecker.sys.mjs +4 −2 Original line number Diff line number Diff line Loading @@ -500,8 +500,10 @@ export var SpellCheckHelper = { return ( // Forms without an explicit action often don't work, see Bug 1960237. form.hasAttribute("action") && // The only other method is dialog. (method == "GET" || method == "POST") && // The other methods are post and dialog. // Post forms are rarely search forms, see discussion in Bug 1964507. // Dialog forms are not supported for obvious reasons. method == "GET" && // SearchEngine objects currently only support urlencoded requests. form.enctype == "application/x-www-form-urlencoded" && // Don't allow forms with file inputs. Loading Loading
browser/components/search/test/browser/browser_addSearchEngineFromForm.js +4 −24 Original line number Diff line number Diff line Loading @@ -27,18 +27,6 @@ const TESTS = [ submission: "kitten", expected: "https://example.org/search?q=kitten&utf8%E2%9C%93=%E2%9C%93", }, { action: "/search", method: "POST", charset: "UTF-8", fields: [ { name: "q", value: "Some initial value", main: true }, { name: "utf8✓", value: "✓", hidden: true }, ], submission: "kitten", expected: "https://example.org/search", expectedPost: "q=kitten&utf8%E2%9C%93=%E2%9C%93", }, { action: "/search", method: "GET", Loading @@ -51,18 +39,6 @@ const TESTS = [ submission: "caff\u00E8+", expected: "https://example.org/search?q=caff%E8%2B&cb=true", }, { action: "/search", method: "POST", charset: "windows-1252", fields: [ { name: "q", main: true }, { name: "foo", value: "bar" }, ], submission: "caff\u00E8+", expected: "https://example.org/search", expectedPost: "q=caff%E8%2B&foo=bar", }, ]; const URL_UTF_8 = Loading Loading @@ -249,6 +225,10 @@ add_task(async function testSearchFieldDetection() { Assert.equal(isSearchField, false, "Method=dialog means no search field"); form.method = "POST"; isSearchField = SpellCheckHelper.isTargetASearchEngineField(input, window); Assert.equal(isSearchField, false, "Method=post means no search field"); form.method = "GET"; delete input.removeAttribute("name"); isSearchField = SpellCheckHelper.isTargetASearchEngineField(input, window); Loading
toolkit/modules/InlineSpellChecker.sys.mjs +4 −2 Original line number Diff line number Diff line Loading @@ -500,8 +500,10 @@ export var SpellCheckHelper = { return ( // Forms without an explicit action often don't work, see Bug 1960237. form.hasAttribute("action") && // The only other method is dialog. (method == "GET" || method == "POST") && // The other methods are post and dialog. // Post forms are rarely search forms, see discussion in Bug 1964507. // Dialog forms are not supported for obvious reasons. method == "GET" && // SearchEngine objects currently only support urlencoded requests. form.enctype == "application/x-www-form-urlencoded" && // Don't allow forms with file inputs. Loading