Reinstate postDataString for about:home searches.
parent
f5333373a6
commit
9998b2436a
|
@ -7,7 +7,7 @@
|
||||||
interface nsIURI;
|
interface nsIURI;
|
||||||
interface nsIInputStream;
|
interface nsIInputStream;
|
||||||
|
|
||||||
[scriptable, uuid(5799251f-5b55-4df7-a9e7-0c27812c469a)]
|
[scriptable, uuid(72599f7a-3712-4b93-90e9-86127006cd68)]
|
||||||
interface nsISearchSubmission : nsISupports
|
interface nsISearchSubmission : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +20,12 @@ interface nsISearchSubmission : nsISupports
|
||||||
* The URI to submit a search to.
|
* The URI to submit a search to.
|
||||||
*/
|
*/
|
||||||
readonly attribute nsIURI uri;
|
readonly attribute nsIURI uri;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The POST data associated with a search submission as an
|
||||||
|
* application/x-www-form-urlencoded string. May be null.
|
||||||
|
*/
|
||||||
|
readonly attribute AString postDataString;
|
||||||
};
|
};
|
||||||
|
|
||||||
[scriptable, uuid(620bd920-0491-48c8-99a8-d6047e64802d)]
|
[scriptable, uuid(620bd920-0491-48c8-99a8-d6047e64802d)]
|
||||||
|
|
|
@ -781,6 +781,7 @@ EngineURL.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var postData = null;
|
var postData = null;
|
||||||
|
let postDataString = null;
|
||||||
if (this.method == "GET") {
|
if (this.method == "GET") {
|
||||||
// GET method requests have no post data, and append the encoded
|
// GET method requests have no post data, and append the encoded
|
||||||
// query string to the url...
|
// query string to the url...
|
||||||
|
@ -788,6 +789,7 @@ EngineURL.prototype = {
|
||||||
url += "?";
|
url += "?";
|
||||||
url += dataString;
|
url += dataString;
|
||||||
} else if (this.method == "POST") {
|
} else if (this.method == "POST") {
|
||||||
|
postDataString = dataString;
|
||||||
// POST method requests must wrap the encoded text in a MIME
|
// POST method requests must wrap the encoded text in a MIME
|
||||||
// stream and supply that as POSTDATA.
|
// stream and supply that as POSTDATA.
|
||||||
var stringStream = Cc["@mozilla.org/io/string-input-stream;1"].
|
var stringStream = Cc["@mozilla.org/io/string-input-stream;1"].
|
||||||
|
@ -801,7 +803,7 @@ EngineURL.prototype = {
|
||||||
postData.setData(stringStream);
|
postData.setData(stringStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Submission(makeURI(url), postData);
|
return new Submission(makeURI(url), postData, postDataString);
|
||||||
},
|
},
|
||||||
|
|
||||||
_getTermsParameterName: function SRCH_EURL__getTermsParameterName() {
|
_getTermsParameterName: function SRCH_EURL__getTermsParameterName() {
|
||||||
|
@ -2410,9 +2412,10 @@ Engine.prototype = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// nsISearchSubmission
|
// nsISearchSubmission
|
||||||
function Submission(aURI, aPostData = null) {
|
function Submission(aURI, aPostData = null, aPostDataString = null) {
|
||||||
this._uri = aURI;
|
this._uri = aURI;
|
||||||
this._postData = aPostData;
|
this._postData = aPostData;
|
||||||
|
this._postDataString = aPostDataString;
|
||||||
}
|
}
|
||||||
Submission.prototype = {
|
Submission.prototype = {
|
||||||
get uri() {
|
get uri() {
|
||||||
|
@ -2421,6 +2424,9 @@ Submission.prototype = {
|
||||||
get postData() {
|
get postData() {
|
||||||
return this._postData;
|
return this._postData;
|
||||||
},
|
},
|
||||||
|
get postDataString() {
|
||||||
|
return this._postDataString;
|
||||||
|
},
|
||||||
QueryInterface: function SRCH_SUBM_QI(aIID) {
|
QueryInterface: function SRCH_SUBM_QI(aIID) {
|
||||||
if (aIID.equals(Ci.nsISearchSubmission) ||
|
if (aIID.equals(Ci.nsISearchSubmission) ||
|
||||||
aIID.equals(Ci.nsISupports))
|
aIID.equals(Ci.nsISupports))
|
||||||
|
|
Loading…
Reference in New Issue