scripts/leetcode.js
/* we will need specific anchor element that is specific to the page you are in Eg. Explore */
we will need specific anchor element that is specific to the page you are in Eg. Explore
we will need specific anchor element that is specific to the page you are in Eg . Explore
function insertToAnchorElement(elem) {
  if (document.URL.startsWith("https://leetcode.com/explore/")) {
    action = document.getElementsByClassName('action');
    if (checkElem(action)
      && checkElem(action[0].getElementsByClassName('row'))
      && checkElem(action[0].getElementsByClassName('row')[0].getElementsByClassName('col-sm-6'))
      && action[0].getElementsByClassName('row')[0].getElementsByClassName('col-sm-6').length > 1) {
      target = action[0].getElementsByClassName('row')[0].getElementsByClassName('col-sm-6')[1]
      elem.className = "pull-left"
      if (target.childNodes.length > 0)
        target.childNodes[0].prepend(elem)
    }
  } else {
    if (checkElem(document.getElementsByClassName('action__38Xc'))) {
      target = document.getElementsByClassName('action__38Xc')[0]
      elem.className = "runcode-wrapper__8rXm"
      if (target.childNodes.length > 0)
        target.childNodes[0].prepend(elem)
    }
  }
}
function insertToAnchorElement ( elem ) { if ( document . URL . startsWith ( "https://leetcode.com/explore/" ) ) { action = document . getElementsByClassName ( 'action' ) ; if ( checkElem ( action ) && checkElem ( action [ 0 ] . getElementsByClassName ( 'row' ) ) && checkElem ( action [ 0 ] . getElementsByClassName ( 'row' ) [ 0 ] . getElementsByClassName ( 'col-sm-6' ) ) && action [ 0 ] . getElementsByClassName ( 'row' ) [ 0 ] . getElementsByClassName ( 'col-sm-6' ) . length > 1 ) { target = action [ 0 ] . getElementsByClassName ( 'row' ) [ 0 ] . getElementsByClassName ( 'col-sm-6' ) [ 1 ] elem . className = "pull-left" if ( target . childNodes . length > 0 ) target . childNodes [ 0 ] . prepend ( elem ) } } else { if ( checkElem ( document . getElementsByClassName ( 'action__38Xc' ) ) ) { target = document . getElementsByClassName ( 'action__38Xc' ) [ 0 ] elem . className = "runcode-wrapper__8rXm" if ( target . childNodes . length > 0 ) target . childNodes [ 0 ] . prepend ( elem ) } } }
we will need specific anchor element that is specific to the page you are in Eg.
we will need specific anchor element that is specific to the page you are in Eg .
// means we are in explore page