-1

I was wondering if it was possible to add live time stamps to omegle using greasemonkey.

I did some digging up and found the function to add time but I got no experience with javascript and was not sure where am I supposed to add the code.

This is the code I found: http://stackoverflow.com/questions/10211145/getting-current-date-and-time-in-javascript

function getCurrentTime() {

   var currentdate = new Date();
  var datetime = currentdate.getDate() + "/"
           + (currentdate.getMonth()+1)  + "/"
           + currentdate.getFullYear() + " @ "
           + currentdate.getHours() + ":"
           + currentdate.getMinutes() + ":"
           + currentdate.getSeconds();
   return datetime;

}

I would appreciate it if someone could point me to the right direction (if this is even possible in the first place)

1 Answers1

0

Here's what I've been using so far. It's terribly hacky but works fine.

if (!window.Timestamp$Element)
    Timestamp$Element = Element; 
Element = function (a, b) {
    let elem = Timestamp$Element(a, b);
    if (typeof a == "string" && b && (b["class"] == "youmsg" || b["class"] == "strangermsg")) {
        let stamp = new Timestamp$Element("span", {"class": "timestamp"});
        stamp.appendText(new Date().toLocaleTimeString() + " ");
        elem.grab(stamp);
    }
    return elem;
};
Object.assign(Element, Timestamp$Element);

Or as a fully-cooked userscript with XrayWrapper handling and such, https://pastebin.com/czc0aLbG