Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Omegle timestamps
- // @version 0
- // @match *://*.omegle.com/
- // @grant unsafeWindow
- // ==/UserScript==
- function win() {
- try {
- return unsafeWindow;
- } catch (e) {
- return window;
- }
- }
- function wrap(fun) {
- try {
- return exportFunction(fun, unsafeWindow);
- } catch (e) {
- return fun;
- }
- }
- function clone(obj) {
- try {
- return cloneInto(obj, unsafeWindow);
- } catch (e) {
- return obj;
- }
- }
- function begin() {
- let window = win();
- if (!window.Element)
- setTimeout(begin, 1000);
- if (!window.Timestamp$Element)
- window.Timestamp$Element = window.Element;
- window.Element = wrap(function (a, b) {
- let clonedB = b && clone(b);
- let elem = window.Timestamp$Element(a, clonedB);
- if (typeof a == "string" && b && (b["class"] == "youmsg" || b["class"] == "strangermsg")) {
- let stamp = new window.Timestamp$Element("span", clone({"class": "timestamp"}));
- stamp.appendText(new Date().toISOString().replace(/T|\..*|Z/g, " "));
- elem.grab(stamp);
- }
- return elem;
- });
- Object.assign(window.Element, window.Timestamp$Element);
- }
- begin();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement