Closed
Bug 241028
Opened 21 years ago
Closed 20 years ago
Should be able to create smart keywords for searches that use HTTP POST
Categories
(Firefox :: Bookmarks & History, defect, P2)
Firefox
Bookmarks & History
Tracking
()
VERIFIED
FIXED
Firefox1.0beta
People
(Reporter: bugs, Assigned: bugs)
Details
Attachments
(2 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
Currently we can only do %s substitution on keywords created using URLs that use HTTP GET via http://www.foo.com/bar.cgi?q=%s The number of HTTP POST search engines is fairly large significant and it'd be worthwhile supporting that too. This requires some modifications to bookmarks and the browser, specifically... Add a new field to bookmarks: POSTDATA="prop1=val1<CRLF>prop2=val2<CRLF>prop3=%s<CRLF>" %s is used (again) to designate the section to be substituted by the user value. The code in browser's getShortcutOrURL is then structured like this: function getShortcutOrURL (aPostDataRef) { if (!bookmarks.resolveKeyword(aPotentialKeywordURL)) { // look for " " in URL // chop keyword off the start var keywordURL = bookmarks.resolveKeyword(keyword); if (keywordURL && userValue) { if (bookmark has postdata) aPostDataRef.value = getPostData(postdata, keyword); else // replace %s in keywordURL with keyword } } } function getPostData(aStringData, aKeyword) { var dataStream = Components.classes["@mozilla.org/io/string-input-stream;1"] .createInstance(Components.interfaces.nsIStringStream); // replace %s in aStringData with aKeyword dataStream.setData(aStringData, aStringData.length); var mimeStream = Components.classes["@mozilla.org/network/mime-input-stream;1"] .createInstance(Components.interfaces.nsIMIMEInputStream); mimeStream.addHeader("Content-Type", "text/plain"); mimeStream.addContentLength = true; mimeStream.setData(dataStream); return mimeStream.QueryInterface(Components.interfaces.nsIInputStream); } The "Add Smart Keyword..." menu item can then be shown for the following cases: - method attribute unspecified - method="GET" - method="POST" and - enctype attribute unspecified - enctype="text/plain"
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → Firefox1.0beta
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Comment 2•21 years ago
|
||
done.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 3•20 years ago
|
||
reopening, this line is wrong: b.loadURIWithFlags(aURI, nsIWebNavigation.LOAD_FLAGS_NONE, - aReferrerURI, null, null); + aReferrerURI, aPostData, null); it is either wrong or insufficient - browser.xml was not changed to accept postdata: http://lxr.mozilla.org/seamonkey/source/toolkit/content/widgets/browser.xml#141 (b is a reference to a <browser>)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 4•20 years ago
|
||
additionally, this caller: + var t = gBrowser.addTab(url, aPostData); // open link in new tab does not match the signature of addTab.
Updated•20 years ago
|
Flags: blocking-aviary1.0?
Whiteboard: see comments 3 and 4
Comment 5•20 years ago
|
||
ben, are you getting this on the 1.0 branch?
Flags: blocking-aviary1.0? → blocking-aviary1.0+
Assignee | ||
Updated•20 years ago
|
Status: REOPENED → RESOLVED
Closed: 21 years ago → 20 years ago
Resolution: --- → FIXED
Comment 7•20 years ago
|
||
First patch: Trunk checkin: 2004-04-20 02:45 (after the 1.7 branch was created, of which aviary branched from). Aviary checkin: 2004-05-16 11:16 and 2004-05-16 20:07. Second patch: Aviary checkin 2004-10-05 21:00. Trunk checkin: None yet.
Keywords: fixed-aviary1.0
Whiteboard: see comments 3 and 4 → needed-trunk, see comment 7
Comment 8•20 years ago
|
||
the code in comment 3 passes the postdata as the 4th parameter, where it should be the 5th. also, shouldn't it pass the charset too?
Comment 9•20 years ago
|
||
Reopening once more.
Status: RESOLVED → REOPENED
Keywords: fixed-aviary1.0
Resolution: FIXED → ---
Whiteboard: needed-trunk, see comment 7 → see comment 8
Comment 11•20 years ago
|
||
comment 8 fixed by jshin in rev. 1.63 of tabbrowser.xml, quoting bug 199237. http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2004-12-26+08%3A58&maxdate=2004-12-26+09%3A00&cvsroot=%2Fcvsroot
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Whiteboard: see comment 8
Comment 12•20 years ago
|
||
Ben, within your initial statement you mentioned a new field for bookmark properties, which should hold the post data. It is still not present in current trunk builds. The users aren't able to change any of the data. Solution: When a bookmark contains a POST_DATA attribute a field for the post data should be shown. => Reopen again.
Comment 13•20 years ago
|
||
This is a field in the datasource, but its not really user-editable, and this is beyond the scope of this bug. What you're asking for is an enhancement, and something I'd WONTFIX most likely, since most users will _not_ understand what this field would be. But at the least, this belongs in a different bug.
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Status: RESOLVED → VERIFIED
Comment 14•18 years ago
|
||
sorry for bugspam, long-overdue mass reassign of ancient QA contact bugs, filter on "beltznerLovesGoats" to get rid of this mass change
QA Contact: mconnor → bookmarks
You need to log in
before you can comment on or make changes to this bug.
Description
•