mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
add global redirection example
This commit is contained in:
parent
68fa9617be
commit
22277c08c3
11 changed files with 35 additions and 21 deletions
|
@ -1,7 +1,7 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content="Hugo 0.123.7">
|
||||
<meta name="generator" content="Hugo 0.124.0">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="alternate" type="application/rss+xml" href="/en/index.xml" title="uweb browser: unlimited power">
|
||||
|
|
13
en/searchurl/globaljs/websocket.js
Normal file
13
en/searchurl/globaljs/websocket.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
window.WebSocketOriginal = window.WebSocket;
|
||||
(function () {
|
||||
function CustomWebSocket(url) {
|
||||
const ws = new window.WebSocketOriginal(url);
|
||||
Object.getOwnPropertyNames(window.WebSocket.prototype).forEach(methodName => {
|
||||
if (methodName !== 'constructor') {
|
||||
CustomWebSocket.prototype[methodName] = ws[methodName].bind(ws);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.WebSocket = CustomWebSocket;
|
||||
})();
|
||||
t
|
Loading…
Add table
Add a link
Reference in a new issue