commit 7a158e3c7d4952e25cf3414bdbe4e59045b6bbbf Author: oloturia <5429234+oloturia@users.noreply.github.com> Date: Mon Sep 18 12:26:38 2023 +0200 first commit diff --git a/chext.crx b/chext.crx new file mode 100644 index 0000000..4ce62f6 Binary files /dev/null and b/chext.crx differ diff --git a/chext.pem b/chext.pem new file mode 100644 index 0000000..41b02af --- /dev/null +++ b/chext.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQhPBrLzGohBrx +T4ffRSvnb9rlTKsSTaCUrGJAp470Yl6mZH38Xl5aLLhq/xdfZTzTA+4LHu7wWlzJ +4mEWK4b2Bq0y7rR7bTfI+xUGcuKcJxEOUSfllKd3F+Sb9hEy6Ng+8mRUbTC5hPAr +MKoPAEXfrV8APOU9vI/742zaoeRjK7cwBS+ICtki4UGSeLHa0VKfmm998i6H6xgq +9PB5VmM4Yj8zf3P4g9AF29qeMFUiKDQuRduL1btMJ4UV+3DXHV0pNWcRwj+GV6dT +UQdgj0G0+S58zyVK8aG/0f8Qgy1rNTN7v76FOCmy+KMrBP/CJkne+4dOOSIPpdyw +J6+BTjlrAgMBAAECggEAB2nSil0BLPaVZqLnN77j0rSdWa2iH2J3JRID5DyQzot4 +xf2opQJN5HLWk6dCE3gr82yeV/Lfl9f+mIbd4MXnZHPUUI1ACWtWomSa2MHY4Kha +6OFlw7nHQmqtDAZxkhfJKGPBwWaoZtAdIcv3H9Vopo0pZX7Ev68mh1QMmLFMx2HE +B6qH5/yM5AQ6A5bFBiopRtZCJzXY8GtHeI695NqbX4bqVQX/R1xSK7mWrDhcPkyd +ZjouaPgDahrEuBVEZaZWSbw8tmAoYBqhNe0RLWibC07BPCLabjKhYccZCUPTkHnR +UkU32MZoboR3zoAUbCPlgEGgvWs4OBt8NHPDbSs3UQKBgQD3qlukqoEci4KsdI28 +e+w6j9mTvcJ9eKGKgljllcnj7TlQ2ZgyArSR+qrzz5fna5Fcu4OyY9qgkLM5s2BE +RcHGHc1QsDI1pYHXxZpUgZcJg8N+Xkv2t4wpNmQMtyn7vAyw7sOHXGNGYXGspJ5A +x+b9BQcIbfWG84WuSc5UzEthLQKBgQDXiVYWWFLspxFzE7k6tOdaUGiiBE5wbRfn +VN1Bpi+FboG49eJj3wAToNyyT0BCyn3S9f2kFepcpFx4xz/tnuaxoB1TZvXqpWTw +O/BeqEcOq6Dc2UirDeVoOyYAX2gLorNo1MgfpdZLJ61h32jXkIQeeAutyTIQ9z3P +6tt0iMWz9wKBgQDttDdzKybyc8A+rzteXX5Ukr5ce7PQ41gAbazO5d45AfWR8NaP +oWMX/QPZMDT2q5p/64WyUP6EP32VcuGBhYY/FVl7CTGXpbuikgjW9O429p1Ki0zT +hkVjRM3wGliUQV/Y7cEDCRxLb7k/31v4hyTfUdT3NTqDhPWYW0RKxS3QHQKBgCqv +XSgxt8J8V71Vk6Jnv0WolQA5IButz0UWDnd45QJk3zX1JC+pM0ev3OVHQq+3kHGe +G+xKFs7gEhwtQaDajk9xKT2iL2OX+8SD6lekteXW4ZW7RmPx7ZPV2vHJ8z4Sq7tA +IJ375tOdeP3gE9BVI4UxOwbgyJSJkmlB1tJeX+EDAoGAJhFbn0IMQN5uSrXKGEbH +cqT2QNLo1M0ikEzZ8i+NWz5ubmFFhamLVJrtJwxrizVuKoImlfzF3CSa3Y2QvdRS +tQJY+iOSE2ik80yziBNVpzny6h5Uz9oKB4tLovYrzOWEpj+q60bS8Z2Y7tDduwGg +8thLtVvHwVc0JKEnK22aUSY= +-----END PRIVATE KEY----- diff --git a/chext/icon.png b/chext/icon.png new file mode 100644 index 0000000..63108c9 Binary files /dev/null and b/chext/icon.png differ diff --git a/chext/main.js b/chext/main.js new file mode 100644 index 0000000..9a8822a --- /dev/null +++ b/chext/main.js @@ -0,0 +1,14 @@ +openWikipediaLibrary = function(word) { + let slOne = word["linkUrl"].indexOf("/"); + let slTwo = word["linkUrl"].indexOf("/",slOne +2); + let result = word["linkUrl"].substr(slOne+2,slTwo-slOne-2); + result = result.replaceAll(".","-"); + result = "https://" + result + ".wikipedialibrary.idm.oclc.org" + word["linkUrl"].substr(slTwo); + chrome.tabs.create({url: result}); +}; + +chrome.contextMenus.create({ + title: "Open in Wikipedia Library", + contexts:["link"], + onclick: openWikipediaLibrary +}); diff --git a/chext/manifest.json b/chext/manifest.json new file mode 100644 index 0000000..c924bcd --- /dev/null +++ b/chext/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "Open in Wikipedia Library", + "version": "1.0", + "manifest_version": 2, + "permissions": [ + "contextMenus", + "tabs" + ], + "background": { + "scripts": [ + "main.js" + ] + }, + "icons": { + "48": "icon.png" + } +} diff --git a/chext/openwiki.html b/chext/openwiki.html new file mode 100644 index 0000000..fbebe6f --- /dev/null +++ b/chext/openwiki.html @@ -0,0 +1,2 @@ + +