Skip to content

Commit b2cbf8f

Browse files
authored
Add files via upload
1 parent 1df6207 commit b2cbf8f

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

ebayprice.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
function init(){
2+
3+
var soldElem = document.getElementById("prcIsum");
4+
if (soldElem == null || soldElem == undefined) return;
5+
6+
var html = document.body.parentElement.innerHTML;
7+
8+
if (!html.includes("\"ended\":true")){
9+
return;
10+
}
11+
var res = /taxExclusivePrice(.*?)",/.exec(html);
12+
13+
if (res != null && res.length>1 && res[0].includes("taxExclusivePrice")){
14+
15+
// check if best offer price is the same
16+
var normPrice = /binPriceOnly(.*?),/.exec(html)
17+
var offerPrice = /taxExclusivePrice(.*?),/.exec(html)
18+
19+
var finalPrice = res[1].replace("\"","").replace(":\"","");
20+
var finalHtml = "";
21+
22+
if (normPrice[1] == offerPrice[1]){
23+
// we have offer, but same price
24+
finalHtml = " - <span style='color: crimson'> Actual Price: N/A </span>";
25+
}else{
26+
finalHtml = " - <span style='color: green'> Actual Price: " + finalPrice + " ⬇ </span>";
27+
}
28+
29+
if (!soldElem.innerHTML.includes("Actual Price")){
30+
soldElem.innerHTML += finalHtml;
31+
}
32+
33+
}
34+
35+
}
36+
37+
if(document.readyState === 'loading') {
38+
document.addEventListener('DOMContentLoaded',afterDOMLoaded);
39+
} else {
40+
init();
41+
}
42+

icons/coins-icon.png

6.78 KB
Loading

manifest.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
3+
"manifest_version": 2,
4+
"name": "eBay Actual Sold Price",
5+
"version": "1.0",
6+
7+
"description": "See the actual sold price of an item on eBay.",
8+
9+
"icons": {
10+
"48": "icons/coins-icon.png",
11+
"96": "icons/coins-icon.png",
12+
"128": "icons/coins-icon.png"
13+
},
14+
15+
"content_scripts": [
16+
{
17+
"matches": ["*://*.ebay.com/*","*://*.ebay.co.uk/*","*://*.ebay.es/*","*://*.ebay.ca/*","*://*.ebay.de/*","*://*.ebay.it/*"],
18+
"js": ["ebayprice.js"]
19+
}
20+
]
21+
22+
}

0 commit comments

Comments
 (0)