可能触发HTTP请求的HTML元素 [英] HTML elements that could trigger an HTTP request

查看:101
本文介绍了可能触发HTTP请求的HTML元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个网页,我想检测:


  • 页面中的哪些元素可能会触发 http 请求?

  • 对于那些
    元素,我想知道 http 方法( POST
    GET ,等等)。



我假设这是一个棘手的问题..但是有没有可以暗示某个选项或另一个选项的指标?

$ b $我认为任何具有URI类型属性的元素都可以触发HTTP请求,并且任何具有属性的元素(如果类型脚本可以触发)都可以触发它通过javascript。



我们可以从这个列表中筛选出来:
https://www.w3.org/TR/REC-html40/index/attributes.html



并基于该问题的接受答案:
完整的具有URL值的HTML标签属性列表?



这给你带有url类型属性的列表(见下面我引用的答案)。

至于脚本类型属性,包括onclick,onkeypress等,这意味着,我相信你会留下一大堆的元素,如果不能触发一个http请求。



引用答案:

查看W3C的HTML属性列表,其中有一个类型列,只需查找URI类型。



当然,这个列表的HTML5版本也很有用。所以对于HTML4我们'已经得到:


  • < a href = url>

  • < applet codebase = url>

  • < area href = url> ;

  • < base href = url>

  • < blockquote cite = url>

  • < ; body background = url>

  • < del cite = url> $ b
  • < form action = url>

  • < frame longdesc = url> < frame src = url>

  • < head profile = url> ;

  • < iframe longdesc = url> < iframe src = url>

  • < img longdesc = url> < img src = url> < img usemap = url>

  • < input src = url> < input usemap = url>

  • < cite = url>

  • < link href = url>

  • < object classid = url> and < object codebase = url> < object data = url> < object usemap = url>
  • li> < q cite = url>
  • < script src = url>


  • HTML 5增加了一些(而HTML5似乎也没有使用上面的一些):


    • < audio src = url>

    • < button formaction = url>

    • < command icon = url>

    • < embed src = url>

    • < html manifest = url>

    • < $ c $< input formaction = url>

    • < source src = url>

    • < video poster = url>和< video src = url>



    这些不一定是简单的网址:




    • < object archive = url>或< object archive =url1 url2 url3>

    • < applet archive = url>或< applet archive = url1,url2,url3>

    • < meta http-equiv =refreshcontent =seconds ; url>



    此外,style属性可以包含带有一个或多个url的css声明。例如:< div style =background:url(image.png)>


    Given a web page, I would like to detect:

    • Which elements in the page might trigger an http request?
    • For those elements, I would like to know what is the http method (POST, GET, etc.) of the relevant request.

    I'm assuming this is a tough question.. but are there any indicators that could hint for one option or another?

    解决方案

    I would say any element having an attribute of type URI will be capable of trigerring an HTTP request, and also any element having an attribute if type script can trigger it through javascript.

    We could filter that out from this list: https://www.w3.org/TR/REC-html40/index/attributes.html

    and based on the accepted answer for this question: COMPLETE list of HTML tag attributes which have a URL value?

    This gives you the list with attributes of type url (see my quoted answer below).

    As for script type attributes, that includes onclick, onkeypress, etc which means, I believe you would be left with a hand full of elements which are not going to be able to trigger an http request if that.

    Quoting the answer:

    Check out the W3C's list of HTML attributes, there's a "type" column in there and just look for URI types.

    And of course the HTML 5 version of that list is useful too

    So for HTML4 we've got:

    • <a href=url>
    • <applet codebase=url>
    • <area href=url>
    • <base href=url>
    • <blockquote cite=url>
    • <body background=url>
    • <del cite=url>
    • <form action=url>
    • <frame longdesc=url> and <frame src=url>
    • <head profile=url>
    • <iframe longdesc=url> and <iframe src=url>
    • <img longdesc=url> and <img src=url> and <img usemap=url>
    • <input src=url> and <input usemap=url>
    • <ins cite=url>
    • <link href=url>
    • <object classid=url> and <object codebase=url> and <object data=url> and <object usemap=url>
    • <q cite=url>
    • <script src=url>

    HTML 5 adds a few (and HTML5 seems to not use some of the ones above as well):

    • <audio src=url>
    • <button formaction=url>
    • <command icon=url>
    • <embed src=url>
    • <html manifest=url>
    • <input formaction=url>
    • <source src=url>
    • <video poster=url> and <video src=url>

    These aren't necessarily simple URLs:

    • <object archive=url> or <object archive="url1 url2 url3">
    • <applet archive=url> or <applet archive=url1,url2,url3>
    • <meta http-equiv="refresh" content="seconds; url">

    In addition, the style attribute can contain css declarations with one or several urls. For example: <div style="background: url(image.png)">

    这篇关于可能触发HTTP请求的HTML元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆