add to git
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
window.onerror = function (error) {
|
||||
parent.document.body.getElementsByTagName("notification-bubbles")[0].add(error, 'syntax-error');
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
try {
|
||||
setTimeout(() => {
|
||||
[replace]
|
||||
});
|
||||
|
||||
}
|
||||
catch (ex) {
|
||||
parent.document.body.getElementsByTagName("notification-bubbles")[0].add(ex, 'syntax-error');
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// define a new console
|
||||
var console=(function(oldCons){
|
||||
return {
|
||||
log: function(text){
|
||||
oldCons.log(text);
|
||||
parent.document.body.getElementsByTagName("notification-bubbles")[0].add(text, 'log');
|
||||
},
|
||||
info: function (text) {
|
||||
oldCons.info(text);
|
||||
parent.document.body.getElementsByTagName("notification-bubbles")[0].add(text, 'info');
|
||||
},
|
||||
warn: function (text) {
|
||||
oldCons.warn(text);
|
||||
parent.document.body.getElementsByTagName("notification-bubbles")[0].add(text, 'warn');
|
||||
},
|
||||
error: function (text) {
|
||||
oldCons.error(text);
|
||||
parent.document.body.getElementsByTagName("notification-bubbles")[0].add(text, 'error');
|
||||
}
|
||||
};
|
||||
}(window.console));
|
||||
|
||||
//Then redefine the old console
|
||||
window.console = console;
|
||||
@@ -0,0 +1,4 @@
|
||||
setTimeout(() => {
|
||||
window.stop();
|
||||
console.log("window stopped");
|
||||
}, 4 * 1000);
|
||||
Reference in New Issue
Block a user