<commit_before>
// The onClicked callback function.
function onClickHandler(info, tab) {
    console.log("item " + info.menuItemId + " was clicked");
    console.log("info: " + JSON.stringify(info));
    console.log("tab: " + JSON.stringify(tab));
    console.log("opening transmission with url :", info.linkUrl);
    urlTransmission = "http://192.168.0.96:9091/transmission/rpc";
    //get torrent method
    // params = {
    //   "arguments": {
    //       "fields": [
    //           "id", 
    //           "name"
    //       ]
    //   }, 
    //   "method": "torrent-get"
    // };
    var params = {
      "arguments":{
        "filename":info.linkUrl  
      },
      "method": "torrent-add"
    };
    var headers = {
      "X-Transmission-Session-Id": "dxl5FFWt6l4VsfDy5ckCQieQ7w5sBdRO5hrlx5IjmOt4gzsJ"
    }
    $.ajax({
      url: urlTransmission,
      type: "post",
      data: JSON.stringify(params),
      headers: headers,
      success: function(data){
        console.log("response : ", JSON.stringify(data));
      }
    });
};

chrome.contextMenus.onClicked.addListener(onClickHandler);

// Set up context menu tree at install time.
chrome.runtime.onInstalled.addListener(function() {
  // Create link on context menu
  var id = chrome.contextMenus.create({"title": title, "contexts":"link","id": "contextLink"});
});<commit_msg>error in link creation fixed, Header change (realy have to fix this...)<commit_after>
// The onClicked callback function.
function onClickHandler(info, tab) {
    console.log("item " + info.menuItemId + " was clicked");
    console.log("info: " + JSON.stringify(info));
    console.log("tab: " + JSON.stringify(tab));
    console.log("opening transmission with url :", info.linkUrl);
    urlTransmission = "http://192.168.0.96:9091/transmission/rpc";
    //get torrent method
    // params = {
    //   "arguments": {
    //       "fields": [
    //           "id", 
    //           "name"
    //       ]
    //   }, 
    //   "method": "torrent-get"
    // };
    var params = {
      "arguments":{
        "filename":info.linkUrl  
      },
      "method": "torrent-add"
    };
    var headers = {
      "X-Transmission-Session-Id": "hJjdAAJl7OQTOYPYOIfOIQ0ycfZO0w9S8czbI1kXNx07ETVv"
    }
    $.ajax({
      url: urlTransmission,
      type: "post",
      data: JSON.stringify(params),
      headers: headers,
      success: function(data){
        console.log("response : ", JSON.stringify(data));
      }
    });
};

chrome.contextMenus.onClicked.addListener(onClickHandler);

// Set up context menu tree at install time.
chrome.runtime.onInstalled.addListener(function() {
  // Create link on context menu
  var id = chrome.contextMenus.create({"title": "Add torrent directly to tranmission...", "contexts":["link"],"id": "contextLink"});
});
{'fraction_non_alphanumeric': 0.16446664288262575, 'fraction_numerical': 0.015340706386014985, 'mean_word_length': 2.4962593516209477, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7333742', 'n_tokens_mistral': 939, 'n_tokens_neox': 901, 'n_words': 169}