File: link_inject.html

package info (click to toggle)
qutebrowser 3.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,432 kB
  • sloc: python: 72,411; javascript: 31,862; sh: 874; xml: 149; makefile: 52
file content (19 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>A link to use hints on</title>
        <script>
            function injectPort() {
                const queryString = document.location.search;
                const params = new URLSearchParams(queryString);
                const port = params.get("port")
                let link = document.getElementById("link");
                link.href = link.href.replace("<port>", port);
            }
        </script>
    </head>
    <body onload="injectPort()">
        <a href="http://localhost:<port>/data/hello.txt" id="link">Follow me!</a>
    </body>
</html>