Skip to content

Commit 5dce6e8

Browse files
committed
Merge
1 parent 00b7ebc commit 5dce6e8

38 files changed

+195
-261
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<p align="center">
2-
<a href="https://csgofloat.com/">
3-
<img width="600" src="https://csgofloat.com/assets/full_logo.png"/>
2+
<a href="https://csfloat.com/">
3+
<img width="600" src="https://csfloat.com/assets/full_logo.png"/>
44
</a>
55
</p>
66

7-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Step7750/CSGOFloat/LICENSE)
8-
[![Website](https://img.shields.io/website-up-down-green-red/https/csgofloat.com.svg)](https://csgofloat.com)
7+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/csfloat/extension/LICENSE)
8+
[![Website](https://img.shields.io/website-up-down-green-red/https/csfloat.com.svg)](https://csfloat.com)
99
[![Chrome Web Store](https://img.shields.io/chrome-web-store/d/jjicbefpemnphinccgikpdaagjebbnhg.svg)](https://chrome.google.com/webstore/detail/csgofloat-market-checker/jjicbefpemnphinccgikpdaagjebbnhg)
1010
[![Chrome Web Store](https://img.shields.io/chrome-web-store/stars/jjicbefpemnphinccgikpdaagjebbnhg.svg)](https://chrome.google.com/webstore/detail/csgofloat-market-checker/jjicbefpemnphinccgikpdaagjebbnhg)
1111
[![Chrome Web Store](https://img.shields.io/chrome-web-store/rating-count/jjicbefpemnphinccgikpdaagjebbnhg.svg)](https://chrome.google.com/webstore/detail/csgofloat-market-checker/jjicbefpemnphinccgikpdaagjebbnhg)
@@ -34,6 +34,26 @@ CSGOFloat has an extension for Firefox/Chrome that lets you fetch floats directl
3434

3535
Please see [`src/`](/src/README.md) for an overview of how the extension works and underlying tech. Contributions are welcome!
3636

37+
### How to Build (Release)
38+
39+
> `npm install`
40+
>
41+
> `npm run build`
42+
43+
The resultant build will be in the `dist/` directory.
44+
45+
Note: You can also use `npm run build_ff` for Firefox
46+
47+
### How to Build (Development)
48+
49+
> `npm install`
50+
>
51+
> `npm run start`
52+
53+
Load the `dist/` directory as a temporary extension in Chrome. Code changes will automatically trigger a re-build.
54+
55+
Note: You can also use `npm run start_ff` for Firefox
56+
3757
## Changelog
3858

39-
See [Releases](https://github.com/csgofloat/extension/releases) for release notes.
59+
See [Releases](https://github.com/csfloat/extension/releases) for release notes.

manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"manifest_version": 3,
3-
"name": "CSGOFloat Market Checker",
4-
"short_name": "CSGOFloat",
5-
"version": "3.1.0",
6-
"description": "Dedicated API for fetching the float value, paint seed, and screenshots of CS:GO items on the Steam Market or Inventories",
3+
"name": "CSFloat Market Checker",
4+
"short_name": "CSFloat",
5+
"version": "3.2.0",
6+
"description": "Shows the float value, paint seed, and screenshots of Counter-Strike (CS:GO & CS2) items on the Steam Market or Inventories",
77
"icons": {
88
"16": "icons/16.png",
99
"48": "icons/48.png",

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"name": "csgofloat-extension",
3-
"version": "3.1.0",
2+
"name": "csfloat-extension",
3+
"version": "3.2.0",
44
"description": "Dedicated API for fetching the float value, paint seed, and screenshots of CS:GO items on the Steam Market or Inventories",
55
"main": ".eslintrc",
66
"directories": {
77
"lib": "src/lib"
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git+https://github.com/csgofloat/extension.git"
11+
"url": "git+https://github.com/csfloat/extension.git"
1212
},
1313
"scripts": {
1414
"build": "webpack --env mode=prod browser=chrome --config webpack.config.js --stats-error-details",
@@ -22,9 +22,9 @@
2222
"author": "step7750",
2323
"license": "MIT",
2424
"bugs": {
25-
"url": "https://github.com/csgofloat/extension/issues"
25+
"url": "https://github.com/csfloat/extension/issues"
2626
},
27-
"homepage": "https://github.com/csgofloat/extension#readme",
27+
"homepage": "https://github.com/csfloat/extension#readme",
2828
"devDependencies": {
2929
"@types/chrome": "^0.0.193",
3030
"@types/firefox-webext-browser": "^111.0.1",

src/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Typically, only being able to access the DOM (ie. HTML env) of the page is not e
3333
changes to the page for your extension.
3434

3535
Historically, many extensions would use on-demand script injection into the page in order to retrieve a variable,
36-
call a function, or mutate page-JS state. This is what our extension [used to do](https://github.com/csgofloat/extension/blob/ca85d56e3b268330537daf6bc6be7837213cc7a4/lib/bridge.js)
36+
call a function, or mutate page-JS state. This is what our extension [used to do](https://github.com/csfloat/extension/blob/ca85d56e3b268330537daf6bc6be7837213cc7a4/lib/bridge.js)
3737
and what others like CSGO-Trader [currently do](https://github.com/gergelyszabo94/csgo-trader-extension/blob/216df0e4eb6c481c893426d2324b93da026e92d3/extension/src/utils/injection.js#L4) (as of 2022/10/01).
3838

3939
Pros
@@ -50,13 +50,13 @@ Cons
5050
Since Steam's Content Security Policy restrictions are applied to the content script's AJAX requests, typically event messaging to the background
5151
script is done. The background script is not restricted and will perform the request for us and send back the result.
5252

53-
This is the mechanism you'd need to use whenever you fetch an HTTPS resource (like `https://api.csgofloat.com`).
53+
This is the mechanism you'd need to use whenever you fetch an HTTPS resource (like `https://api.csfloat.com`).
5454

5555
A naiive example would be:
5656

5757
`content_script.js`
5858
```javascript
59-
chrome.runtime.sendMessage({type1: 'https://api.csgofloat.com/?url=steam://....'}, (response) => {
59+
chrome.runtime.sendMessage({type1: 'https://api.csfloat.com/?url=steam://....'}, (response) => {
6060
// do something
6161
});
6262
```
@@ -81,11 +81,11 @@ Cons
8181
* Type-checking is _hard_, easy to lose context of what you expect a request to return
8282
8383
84-
### How CSGOFloat's Extension Works
84+
### How CSFloat's Extension Works
8585
8686
#### Accessing the Page's JS runtime
8787
88-
Almost the entirety of CSGOFloat's Extension runs within the page context and **not** the content script.
88+
Almost the entirety of CSFloat's Extension runs within the page context and **not** the content script.
8989
9090
This allows us to easily access page globals, call Steam's functions, override their functions. Additionally, this gives a clear
9191
consistent environment to think about as a developer.
@@ -99,7 +99,7 @@ script. This effectively tells Chrome to re-run the script, but in the page inst
9999
Now that our scripts run within the page, we still want to be able to make AJAX requests to other domains outside of
100100
Steam's Content Security Policy.
101101
102-
CSGOFloat's Extension similarly uses the mechanism of making the actual request in a background script, but
102+
CSFloat's Extension similarly uses the mechanism of making the actual request in a background script, but
103103
creates an abstraction layer on top.
104104
105105
Dubbed the "bridge", it allows for **type safe** request and response handling between the page and background script.
@@ -117,7 +117,7 @@ You can find more details in `/bridge`.
117117
When try to mutate a page, you also want the ability to create new UI components, potentially _reusing_ the styling
118118
on the page. For example, you'd create a component that shows the float for a given item.
119119
120-
CSGOFloat's Extension uses Web Components via the library [Lit](https://lit.dev/). Each UI mutation is a separate
120+
CSFloat's Extension uses Web Components via the library [Lit](https://lit.dev/). Each UI mutation is a separate
121121
component that has its own state management and rendering logic.
122122
123123
You can find our components in `/components`.

src/background_ff.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<title>CSGOFloat Background</title>
8+
<title>CSFloat Background</title>
99
<script type="module" src="./background.js"></script>
1010
</head>
1111
<body>

src/global.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.csgofloat-stickers-container {
1+
.csfloat-stickers-container {
22
float: right;
33
}
44

5-
.csgofloat-easy-inspect {
5+
.csfloat-easy-inspect {
66
position: absolute;
77
height: 74px;
88
width: 74px;
@@ -15,18 +15,18 @@
1515
font-size: 20px;
1616
}
1717

18-
.market_recent_listing_row:hover .csgofloat-easy-inspect {
18+
.market_recent_listing_row:hover .csfloat-easy-inspect {
1919
display: initial;
2020
}
2121

2222
/* Powers animation for shining float boxes */
23-
.csgofloat-shine {
23+
.csfloat-shine {
2424
overflow: hidden;
2525
}
2626

2727
/* Based on https://jsfiddle.net/AntonTrollback/nqQc7/ */
28-
.csgofloat-shine:after {
29-
animation: csgofloat-shine-frames 4s ease-in-out infinite;
28+
.csfloat-shine:after {
29+
animation: csfloat-shine-frames 4s ease-in-out infinite;
3030
content: '';
3131
position: absolute;
3232
top: -110%;
@@ -46,7 +46,7 @@
4646
);
4747
}
4848

49-
@keyframes csgofloat-shine-frames {
49+
@keyframes csfloat-shine-frames {
5050
50% {
5151
opacity: 1;
5252
top: -30%;

src/lib/bridge/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function ClientSend<Req, Resp>(handler: RequestHandler<Req, Resp>,
2525
return new Promise((resolve, reject) => {
2626
// @ts-ignore Bad types
2727
runtimeNamespace().runtime.sendMessage(
28-
window.CSGOFLOAT_EXTENSION_ID || chrome.runtime.id,
28+
window.CSFLOAT_EXTENSION_ID || chrome.runtime.id,
2929
bundle,
3030
// @ts-ignore Bad types
3131
(resp: InternalResponseBundle) => {

src/lib/bridge/handlers/csmoney_price.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/lib/bridge/handlers/execute_script.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export const ExecuteScriptOnPage = new PrivilegedHandler(
1717
world: 'MAIN',
1818
args: [chrome.runtime.id, chrome.runtime.getURL('src/model_frame.html')],
1919
func: function ExtensionId(extensionId, modelFrameUrl) {
20-
window.CSGOFLOAT_EXTENSION_ID = extensionId;
21-
window.CSGOFLOAT_MODEL_FRAME_URL = modelFrameUrl;
20+
window.CSFLOAT_EXTENSION_ID = extensionId;
21+
window.CSFLOAT_MODEL_FRAME_URL = modelFrameUrl;
2222
},
2323
});
2424

0 commit comments

Comments
 (0)