Closed Bug 6117 Opened 26 years ago Closed 24 years ago

[FEATURE] Append CCK's custom string to browser's user agent string

Categories

(SeaMonkey :: UI Design, defect, P1)

x86
Windows 95
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: robinf, Assigned: vparthas)

References

Details

(Whiteboard: [nsbeta2-][nsbeta3+][pdtp1])

We want to be able to append the "Company Identifier" string that the CCK user enters in the CCK Wizard to the browser's user agent string. Not sure what Component category this bug belongs to, so I just took a guess.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 806 ***
Status: RESOLVED → VERIFIED
Verified Dup...see Bug 806 comments
Status: VERIFIED → REOPENED
I don't believe this was appropriate to dup to 806 since the fix for 806 didn't include this feature. In 4.x (according to the old winfe/nsapp.cpp) we keyed off the existence of a configuration pref called "user_agent" and when it existed we would add C-<user_agent_prev_value> to the user agent string. See the routine ResolveAppVersion for the exact code. There appear to be other places where this logic existed since winfe/custom.cpp did something almost but not quite identical.
Assignee: selmer → don
Status: REOPENED → NEW
Don, I'm sending this back to you with the info on how we did this in 4.x.
Resolution: DUPLICATE → ---
Clearing Duplicate resolution due to ReOpen of this bug.
Component: UE/UI → XPApps
Priority: P3 → P1
Summary: Append CCK's custom string to browser's user agent string → [FEATURE] Append CCK's custom string to browser's user agent string
Target Milestone: M10
Move to M10 until I can figure out when we can do this ...
Blocks: 10575
Whiteboard: Need to find an owner for this
Target Milestone: M10 → M15
Target Milestone: M15 → M14
Target Milestone: M14 → M15
Move to M15. Not a beta 1 requirement.
No longer blocks: 10575
The mighty user agent service will slay this foul beast! The pref in question is just "user_agent"?
Depends on: 24336
Whiteboard: Need to find an owner for this
Target Milestone: M15 → M14
Do we have to fix this for M14?
CC:'ing Bijal so he can answer Don's question. Is this a Beta 1 feature for CCK?
This is a beta 2 feature, especially since netscape.cfg is a beta 2 feature for Seamonkey.
Adding to CCK tracking bug.
Blocks: 7579
*** Bug 20941 has been marked as a duplicate of this bug. ***
Don, it may be that this should be assigned to shaver. I just marked 20941 as a dup of this because this one is older. 20941 was assigned to shaver and we had worked out how this was to be implemented. Adding shaver to the cc list.
Blocks: 32731
Move to M16 ...
Target Milestone: M14 → M16
M17 for mcafee ...
Assignee: don → mcafee
Keywords: nsbeta2
Target Milestone: M16 → M17
Putting on [nsbeta2+][5/16] radar. This is a feature MUST complete work by 05/16 or we may pull this feature for PR2.
Whiteboard: [nsbeta2+][5/16]
I have no idea what this bug is about. Can someone shed some light here?
This bug will give a better understanding of the problem. A pref is needed so that the user agent string gets the "C-" tag inserted and then the value of the pref gets added as well -> in the form of Netscape 5.0 [en] C- <foo>.We can choose to have a different tag for mozilla say "M-". The length of this value can be limited to say 10 extra characters or so. Adding myself to CC.
Move to M19 target milestone.
Target Milestone: M17 → M19
Don, this bug is a requirement for CCK's PR2 features. PDT marked the bug nsbeta2+ so we are expecting this to be fixed. Is there a change in the plans?
Putting on [nsbeta2-] radar. Removing [5/16]. Will do for nsbeta3
Keywords: nsbeta3
Whiteboard: [nsbeta2+][5/16] → [nsbeta2-]
user-agent, gagan
Assignee: mcafee → gagan
Assignee: gagan → valeski
I think valeski added the code for customizing the user-agent. So it might just be him explaining how to do it.
use this attribte, http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/public/nsIHTTPProt ocolHandler.idl#152. First *get* the attribute, append your string to it, then set the whole string back in using that attribute.
Status: NEW → RESOLVED
Closed: 25 years ago24 years ago
Resolution: --- → FIXED
Re-opening bug. We need a pref to do this change.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reassigning to XPapps to implement a preference that will customize the user agent string.
Assignee: valeski → don
Status: REOPENED → NEW
QA Contact: sairuh
Whiteboard: [nsbeta2-]
This is an extremely critical bug/feature for N6 Client Customization Kit. The most basic customization is appending to the user agent string already in the browser. CCK tool tags anyone who uses CCK to customize the browser with "-CCK". Distributors can also add their own tag to the user agent string. This tagged user agent string is used to measure indirect revenue from distributors. Bill Law and I talked about this and we could easily append the CCK string to the vendor portion. In Communicator 4.x and CCK 4.x, the following javascript is in the netscape.cfg for the user agent string append command: with (PrefConfig) { config("user_agent", "CCK-MCD bij's browser"); }
Putting on [nsbeta2-] since PR2 is outta here.
Whiteboard: [nsbeta2-]
Does: with (PrefConfig) { config("user_agent", "CCK-MCD bij's browser"); } put an entry in prefs.js or somewhere else (e.g., netscape.cfg or equivalent)? I guess what I need to know is how to get this value *out* (from wherever it goes).
Not sure it puts a value at all. Basically, the code I supplied is in the netscape.cfg which is a hashed preference file in Communicator. Everytime you launch Communicator, this file is read and it appends to the user agent string dynamically. Therefore, this javascript does not change the actual user agent string in Communicator code.
OK, I think I've found what I need. The 4.x code calls PREF_CopyConfigString to get this customized user agent string. I'll use the same API (it's in the 6.0 version of prefapi). Yo, Varada; does that sound right?
with (PrefConfig) { config("user_agent", "CCK-MCD bij's browser"); } is present in the prefs.js which is the input to create the netscape.cfg. This will change the value of the pref IFF the pref exists and not otherwise and so in reply to your question. Yes you are right :-)
Use of the non-XPCOM pref API makes me wince. Is it really necessary?
Status: NEW → ASSIGNED
I guess that's what I'm asking. I don't understand this netscapt.cfg magic. If I just read the "user_agent" pref using the conventional means would I get what I need? Varada, does that question make sense? If so, what's the answer?
over to paw for qa triage.
QA Contact: sairuh → paw
I believe so. The preferenes are read during launch of Seamonkey. When an end user changes his/her preferences through the edit dialog, they are changed in memory, but not on disk. When the browser is closed (quit), the preferences are saved. This user agent preference is read on launch and there is no way to change it from the client.
Assignee: don → law
Status: ASSIGNED → NEW
Depends on: 5132
Whiteboard: [nsbeta2-] → [nsbeta2-][nsbeta3+]
Marking [nsbeta3+] per discussion with Bijal. Note that this bug depends on 5132.
yes, don't worry about libpref's unique way of defining prefs, just use CopyCharPref where appropriate
Please make it so that we can put this special "user agent" string in any prefs file such as foo.js. Therefore, you do not need to have netscape.cfg to have this preference working.
I found out that our http protocol handler is already using the content of various pref settings to determine the user agent string. See http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHTTPHandler. cpp#615. This means that if CCK arranged to set, say, "general.useragent.vendorComment" then that would automatically appear in the user agent string. I think that might be better than adding additional code on top of what's there already. For example, you could put this in your prefs.js right now: user_pref("general.useragent.vendorComment", "CCK-MCD bij's browser"); The only drawback would be if CCK is only capable of setting the "user_agent" pref, rather than "general.useragent.vendorComment" (or some other general.useragent pref). Can CCK use the existing pref? Or, do I need to add the code that extracts the "user_agent" pref and inserts it into the vendor comment field?
Status: NEW → ASSIGNED
We think CCK can manage this by simply setting the general.useragent.vendorComment pref (rather than the user_agent pref). So, I'm reassigning to Varada to prompt him (or somebody) to tweak CCK to do that. Leaving [nsebeta3+]; hope that's OK.
Assignee: law → varada
Status: ASSIGNED → NEW
PDT agrees P1
accepting
Status: NEW → ASSIGNED
Adding [pdtp1] in status summary.
Whiteboard: [nsbeta2-][nsbeta3+] → [nsbeta2-][nsbeta3+][pdtp1]
The user agent which is an aggregate of 8 different pref values including the vendor comment. The vendor comment is given the value of the customized string thru CCK. This then gets inserted in the pref file and is read by the browser and is used while creating the overall value for the navigator.userAgent.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Varada, please add to this bug examples of the following: *user agent string customized by CCK user (for example, MyISP) *user agent string default (not customized by CCK user) Thanks.
Updating QA Contact
QA Contact: paw → bmartin
updating QA Contact to blee@netscape.com
QA Contact: bmartin → blee
qa to me since blee is on sabatical. Verified on CCK build 2001-09-24-07
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.