User:Alexis Jazz/Factotum-ES5.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:Alexis Jazz/Factotum-ES5. |
/*
Some IE11 hacking for Factotum. Does Factotum work on ES5 browsers like IE11?
Short answer: no.
Longer answer: not really. Nothing works on IE11. This file exists merely for your enterainment. I didn't even bother actually implementing Object.assign.
This crap is irrevocably released as WTFPL Version 2[www.wtfpl.net/about/] by its author, Alexis Jazz.
Put this crap after var FTT = window.FTT; and remove the 'use strict'; line. I managed to open a form, didn't try anything else.
*/
if ( typeof Object.values == 'undefined' ) { //IE sux
Object.values = function(obj1,suxInt,arr) {
arr = [];
for (suxInt=0;suxInt<Object.keys(obj1).length;suxInt++) {
arr.push(obj1[Object.keys(obj1)[suxInt]]);
}
return arr;
};
}
if ( typeof mw.loader.using == 'undefined' ) { //IE sux
mw.loader.using = function(a,callback) {
callback();
};
}
if ( typeof Array.prototype.includes == 'undefined' ) { //IE sux
Array.prototype.includes = function(val) {
if ( this.indexOf(val) == -1 ) {
return false;
} else {
return true;
}
};
}
if ( typeof Object.assign == 'undefined' ) { //IE sux
Object.assign = function(a,b){
return a; // YOLO
};
}
if ( typeof Array.from == 'undefined' ) { //IE sux
Array.from = function(a,b,c) {
c = [];
for (b=0;b<Object.keys(a).length;b++) {
c.push(a[Object.keys(a)[b]]);
if ( b > 20000 ) {break;}
}
return c;
};
}