Browse Source

initial commit

master
s2 1 year ago
commit
8140e9d87f
6 changed files with 90 additions and 0 deletions
  1. +33
    -0
      .eslintrc.json
  2. +10
    -0
      README.md
  3. +19
    -0
      src/background.js
  4. +28
    -0
      src/manifest.json
  5. BIN
      src/resources/icon-24.png
  6. BIN
      src/resources/icon-48.png

+ 33
- 0
.eslintrc.json View File

@ -0,0 +1,33 @@
{"parserOptions":
{"ecmaVersion": 6},
"rules": {
"quotes": [2, "single", {"allowTemplateLiterals": true}],
"curly": [2, "all"],
"keyword-spacing": [2, {"overrides": {"else": {"before": true}, "catch": {"before": true, "after": false}}}],
"space-before-blocks": [2, "always"],
"wrap-iife": [2, "inside"],
"space-before-function-paren": [2, "never"],
"one-var": [2, "never"],
"vars-on-top": 0, "no-empty": [2, {"allowEmptyCatch": true}],
"array-bracket-spacing": [2, "never"],
"space-in-parens": [2, "never"],
"no-underscore-dangle": 0,
"comma-style": [2, "last"],
"comma-spacing": [2, {"before": false, "after": true}],
"space-unary-ops": [2, {"words": false, "nonwords": false}],
"no-multi-spaces": 2,
"space-infix-ops": 2,
"no-with": 2,
"indent": [2, "tab", {"SwitchCase": 1, "FunctionExpression": {"body": 1, "parameters": 1}, "MemberExpression": 0}],
"no-mixed-spaces-and-tabs": 2,
"no-trailing-spaces": 2,
"comma-dangle": [2, "never"],
"semi": [2, "always"],
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"eol-last": 2,
"dot-notation": 0,
"no-multi-str": 2,
"key-spacing": [2, {"afterColon": true}],
"func-call-spacing": [2, "never"]
}
}

+ 10
- 0
README.md View File

@ -0,0 +1,10 @@
# fcku.it
## What it does
A firefox addon that let's you post a link of the current page to fcku.it
## install
On amo!
[https://addons.mozilla.org/firefox/addon/fcku.it/](https://addons.mozilla.org/firefox/addon/fcku.it/)

+ 19
- 0
src/background.js View File

@ -0,0 +1,19 @@
function openInPopup(url, width, height) {
browser.windows.create({
url,
type: 'popup',
allowScriptsToClose: true,
width,
height
});
}
function shareCurrentTab(tab) {
const url = tab.url;
const title = tab.title || url;
const shareUrl = `https://fcku.it/thread/new?subject=${encodeURIComponent(title)}&body=${encodeURIComponent(url)}&source=ffaddon`;
//https://fcku.it/thread/new?subject=sss&body=zzzz
openInPopup(shareUrl, 800, 600);
}
browser.browserAction.onClicked.addListener(shareCurrentTab);

+ 28
- 0
src/manifest.json View File

@ -0,0 +1,28 @@
{
"description": "A firefox addon that let's you post a link of the current page to fcku.it",
"manifest_version": 2,
"name": "fcku.it",
"version": "1.0.0",
"homepage_url": "https://fcku.it/",
"applications": {
"gecko": {
"id": "{70e52a0a-e310-4cf3-9246-6849be580974}"
}
},
"icons": {
"48": "resources/icon-48.png"
},
"permissions": ["tabs"],
"background": {
"scripts": ["background.js"]
},
"browser_action": {
"default_icon": "resources/icon-24.png",
"default_title": "fcku.it"
},
"page_action": {
"browser_style": false,
"default_icon": "resources/icon-24.png",
"default_title": "fcku.it"
}
}

BIN
src/resources/icon-24.png View File

Before After
Width: 24  |  Height: 9  |  Size: 642 B

BIN
src/resources/icon-48.png View File

Before After
Width: 48  |  Height: 18  |  Size: 1.2 KiB

Loading…
Cancel
Save