简体   繁体   中英

Is it possible to specify user agent with URL in HTML?

I'm working on a mail server that sends HTML emails down to a mail client. Can the HTML DOM be modified to indicate that either a single or all URLs ( <a href=""> elements) use a specific user agent? The integrated browser in our custom client could inspect the HTML to determine what user agent to use and then take that into account when opening the URL.

If it's possible to add a custom (non-standard) attribute to the <a> element or possibly a child element to it, that'd work too, if it's valid to do so. Thanks in advance.

Can the HTML DOM be modified to indicate that either a single or all URLs ( <a href=""> elements) use a specific user agent?

Not in any standard way.

If it's possible to add a custom (non-standard) attribute to the element or possibly a child element to it, that'd work too, if it's valid to do so.

"non-standard" is practically invalid by definition.

There is a loophole in data- attributes (since they are defined by the specification as a way to add extensions) but:

  • "These attributes are not intended for use by software that is independent of the site that uses the attributes"
  • HTML 5 is a Candidate Recommendation, not a standard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM