summaryrefslogtreecommitdiffstats
path: root/testing/marionette/harness/marionette_harness/www/clicks.html
blob: 96e9f551717c74cefd54eca6c117641fdcf12b22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html>
<head>
  <!-- This Source Code Form is subject to the terms of the Mozilla Public
     - License, v. 2.0. If a copy of the MPL was not distributed with this
        - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
  <title>Testing Clicks</title>

  <script>
    function addMousedownListener() {
      let el = document.getElementById('showbutton');

      el.addEventListener('mousedown', function (evt) {
        evt.target.innerText = evt.button;
      });
    }
  </script>
</head>

<body>
<h1>Testing Clicks</h1>

<div>
  <p id="links">Links:</p>
  <ul>
    <li><a href="test.html">333333</a>
    <li><a href="test.html" id="normal">Normal</a>
    <li><a href="#" id="anchor">I go to an anchor</a>
    <li><a href="addons/webextension-unsigned.xpi" id="install-addon">Install Add-on</a>
  </ul>
</div>

<div>
  <p id="js-links">Javascript links:</p>
  <ul>
    <li>Navigate in history:
      <a href="javascript:history.back();" id="history-back">Back</a>
      <a href="javascript:history.forward();" id="history-forward">Forward</a>
    <li><a href="javascript:window.open('test.html', '_blank')" id="new-window">Open a window</a>
    <li><a href="javascript:window.close();" id="close-window">Close tab/window</a>
    <li><a id="addbuttonlistener" href="javascript:addMousedownListener();">Click</a> to
      add an event listener for: <span style="color: red;" id="showbutton">button click</span>
  </ul>
</div>

<div>
  <p id="special">Special:</p>
  <select id="option" onclick="window.location = '/slow?delay=1'">
    <option>Click to navigate</option>
  </select>

  <p style="background-color: rgb(0, 255, 0); width: 5em;">
    <a id="overflowLink" href="test.html">looooooooooong short looooooooooong</a>
  </p>
</div>

</body>
</html>