first commit

This commit is contained in:
oloturia 2023-09-18 12:26:38 +02:00
commit 7a158e3c7d
6 changed files with 61 additions and 0 deletions

BIN
chext.crx Normal file

Binary file not shown.

28
chext.pem Normal file
View file

@ -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-----

BIN
chext/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

14
chext/main.js Normal file
View file

@ -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
});

17
chext/manifest.json Normal file
View file

@ -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"
}
}

2
chext/openwiki.html Normal file
View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<html><script src="main.js"></script></html>