<commit_before>(function () {

  window.remotedebug = {}
  window.remotedebug.requestAccess = function () {
    if (window.confirm('Do you want to allow <name> to remote debug your tab?')) {
      chrome.runtime.sendMessage({
        cmd: 'attach'
      })
    }
  }

  window.remotedebug.requestAccess()

})()
<commit_msg>Inject window.remoteDebug API into pages. <commit_after>(function () {

  document.addEventListener('RemoteDebug.requestAccess', function (e) {
    chrome.runtime.sendMessage({
      cmd: 'attach'
    })
  });

  var s = document.createElement('script');
  s.textContent = '(' + function() {
    window.remoteDebug = {}
    window.remoteDebug.requestAccess = function (requester) {
      if (window.confirm('Do you want to allow ' + requester + ' to remote debug this tab?')) {
        
        var evt = document.createEvent("CustomEvent");
        evt.initCustomEvent("RemoteDebug.requestAccess", true, true);
        document.dispatchEvent(evt);

      }
    }
  } + ')();';

  document.documentElement.appendChild(s);
  s.parentNode.removeChild(s);  

})()

{'fraction_non_alphanumeric': 0.14852398523985239, 'fraction_numerical': 0.0, 'mean_word_length': 3.173076923076923, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6930261', 'n_tokens_mistral': 324, 'n_tokens_neox': 323, 'n_words': 62}