Skip to content

Commit

Permalink
Release 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Aug 29, 2023
1 parent 7fe032a commit 9915079
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@

## Highlights

Currently supports CSFloat.com and Skinport.com, but more sites are coming soon!

- Display Buff prices (buy order + listings) for every item
- Auto-refresh in the "Newest Items"
- Price difference to Buff at first glance next to the price tag
- Accurate sticker price calculation (%sp) with gradual coloring
- CSFloat: Auto-refresh in the "Newest Items"
- CSFloat: See the listing age of an item
- Skinport: Automatically check the checkboxes in the cart for faster buying
- Skinport: Multiple currency conversion options
- More coming soon!

## Services
Expand Down Expand Up @@ -92,6 +99,6 @@ Please follow the [conventional commits](https://www.conventionalcommits.org/en/

## Disclaimer

BetterFloat is developed independently, and is not officially endorsed by or affiliated with CSFloat in any way. If you are a legal representative of CSFloat and would like this project to be taken down, please contact me.
BetterFloat is developed independently, and is not officially endorsed by or affiliated with CSFloat Inc. or Skinport GmbH in any way. If you are a legal representative of CSFloat or Skinport and would like this project to be taken down, please contact me directly.

Built with 🖤 in Munich
Built with 🖤 in Munich.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"permissions": ["storage"],
"web_accessible_resources": [ {
"matches": [ "https://csfloat.com/*", "https://csgofloat.com/*", "*://*.skinport.com/*" ],
"matches": [ "https://csfloat.com/*", "https://csgofloat.com/*", "*://*.skinport.com/*"],
"resources": [ "public/buff_favicon.png", "public/clock-solid.svg", "public/chevron-up-solid.svg", "js/inject.js"]
} ]
}
24 changes: 15 additions & 9 deletions manifest_firefox.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{
"name": "BetterFloat",
"author": "Rums",
"version": "1.3.2",
"description": "Enhance your experience on CSFloat.com",
"version": "1.4.0",
"description": "Enhance your experience on CSFloat.com and Skinport.com",
"manifest_version": 3,
"host_permissions": ["*://prices.csgotrader.app/*", "*://csfloat.com/*"],
"host_permissions": ["*://prices.csgotrader.app/*", "*://csfloat.com/*", "*://*.skinport.com/*"],
"background": {
"scripts": ["js/background.js"]
},
"content_scripts": [
{
"matches": ["https://csfloat.com/*", "https://csgofloat.com/*"],
"js": ["js/content_script.js"],
"css": ["css/stylesheet.css"],
"run_at": "document_idle"
"matches": ["*://*.csfloat.com/*", "*://*.csgofloat.com/*"],
"js": ["js/csfloat/content_script.js"],
"css": ["css/csfloat_styles.css"],
"run_at": "document_end"
},
{
"matches": ["https://csfloat.com/*", "https://csgofloat.com/*"],
"matches": ["https://csfloat.com/*", "https://csgofloat.com/*", "*://*.skinport.com/*"],
"js": ["js/injectionhandler.js"],
"run_at": "document_start"
},
{
"matches": ["*://*.skinport.com/*"],
"js": ["js/skinport/content_script.js"],
"css": ["css/skinport_styles.css"],
"run_at": "document_idle"
}
],
"icons": {
Expand All @@ -39,7 +45,7 @@
"permissions": ["storage"],
"web_accessible_resources": [
{
"matches": ["https://csfloat.com/*", "https://csgofloat.com/*"],
"matches": ["https://csfloat.com/*", "https://csgofloat.com/*", "*://*.skinport.com/*"],
"resources": ["public/buff_favicon.png", "public/clock-solid.svg", "public/chevron-up-solid.svg", "js/inject.js"]
}
]
Expand Down
12 changes: 9 additions & 3 deletions src/mappinghandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ export async function getItemPrice(buff_name: string): Promise<{ starting_at: nu
};
}
}
if (priceMapping[buff_name]) {
return {
starting_at: priceMapping[buff_name]['buff163']['starting_at']['price'] ?? 0,
highest_order: priceMapping[buff_name]['buff163']['highest_order']['price'] ?? 0,
};
}
return {
starting_at: priceMapping[buff_name]['buff163']['starting_at']['price'] ?? 0,
highest_order: priceMapping[buff_name]['buff163']['highest_order']['price'] ?? 0,
};
starting_at: 0,
highest_order: 0,
}
}

export async function getUserCurrencyRate(rates: "skinport" | "real" = "real") {
Expand Down
8 changes: 4 additions & 4 deletions src/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ $(function () {
$('#version').text('Version: ' + chrome.runtime.getManifest().version);

// init loading of content
$('.MainContent').load('settings.html', function () {
$('.MainContent').load('csfloat.html', function () {
//Loading complete
loadSettings('settings.html');
loadSettings('csfloat.html');
addListeners();
});

//add listeners to all tabs
$('.tabItem').on('click', function (e) {
e.preventDefault();
let url = e.currentTarget.getAttribute('data-page') ?? 'settings.html';
let url = e.currentTarget.getAttribute('data-page') ?? 'csfloat.html';
$('.MainContent').load(url, function () {
//Loading complete
loadSettings(url);
Expand Down Expand Up @@ -173,7 +173,7 @@ function loadForSkinport() {
}

function loadSettings(url: string) {
if (url == 'settings.html') {
if (url == 'csfloat.html') {
loadForSettings();
} else if (url == 'skinport.html') {
loadForSkinport();
Expand Down
2 changes: 1 addition & 1 deletion src/skinport/content_script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ async function getBuffPrice(item: Skinport.Listing): Promise<{ buff_name: string
if (typeof helperPrice == 'number') {
priceListing = helperPrice;
priceOrder = helperPrice;
} else {
} else if (priceMapping[buff_name]) {
if (item.style != '' && item.style != 'Vanilla') {
priceListing = priceMapping[buff_name]['buff163']['starting_at']['doppler'][item.style];
priceOrder = priceMapping[buff_name]['buff163']['highest_order']['doppler'][item.style];
Expand Down

0 comments on commit 9915079

Please sign in to comment.