mirror of
https://gitlab.com/octtspacc/OcttKB
synced 2025-06-06 00:29:12 +02:00
[Manual] Add scripts and raw wiki
This commit is contained in:
17
Wiki/tiddlers/$__OcttKB_Polyfills.js
Normal file
17
Wiki/tiddlers/$__OcttKB_Polyfills.js
Normal file
@ -0,0 +1,17 @@
|
||||
/*\
|
||||
Load our custom polyfills, for old browsers support.
|
||||
\*/
|
||||
exports.startup = function() {
|
||||
try {
|
||||
|
||||
// https://stackoverflow.com/a/63958411
|
||||
String.prototype.replaceAllTxt = function replaceAll(search, replace) {
|
||||
return this.split(search).join(replace);
|
||||
};
|
||||
|
||||
} catch(e) {
|
||||
const Str = `${e.stack.split('\n')[0]}: ${e}`
|
||||
console.log(Str);
|
||||
return Str;
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user