Skip to content

Commit

Permalink
Merge pull request #26 from Arcus92/settings
Browse files Browse the repository at this point in the history
Extension settings, fullscreen and picture-in-picture (Chrome only)
  • Loading branch information
Arcus92 authored Apr 1, 2024
2 parents 3cb960d + 4475053 commit 8466aaf
Show file tree
Hide file tree
Showing 40 changed files with 844 additions and 130 deletions.
24 changes: 0 additions & 24 deletions chrome/manifest.json

This file was deleted.

Binary file removed content/icons/icon-128.png
Binary file not shown.
Binary file removed content/icons/icon-48.png
Binary file not shown.
Binary file removed content/icons/icon-64.png
Binary file not shown.
29 changes: 0 additions & 29 deletions firefox/manifest.json

This file was deleted.

94 changes: 94 additions & 0 deletions graphics/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed graphics/icon.xcf
Binary file not shown.
9 changes: 5 additions & 4 deletions pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const childProcess = require('child_process');

const distPath = path.join(__dirname, 'dist');
const sourcePath = path.join(__dirname, 'dist', 'js');
const contentPath = path.join(__dirname, 'content');
const staticPath = path.join(__dirname, 'src', 'static');

// Getting the version from the package.json
const versionBuffer = childProcess.execSync("npm pkg get version --parseable", { encoding: 'utf8' });
Expand All @@ -16,8 +16,9 @@ const platformNames = ['firefox', 'chrome'];
for (const platformName of platformNames) {
console.log(`Packing plugin for ${platformName}...`);
const platformDistPath = path.join(distPath, platformName);
const platformSourceDistPath = path.join(distPath, platformName, 'js');
const platformDistManifestPath = path.join(distPath, platformName, 'manifest.json');
const platformManifestPath = path.join(__dirname, platformName, 'manifest.json');
const platformManifestPath = path.join(__dirname, 'src', 'manifest', `${platformName}.json`);
const platformZipPath = path.join(distPath, platformName + '.zip');

// Clear output directory
Expand All @@ -28,8 +29,8 @@ for (const platformName of platformNames) {
}

// Copy content. TypeScript must be compiled by now.
fs.cpSync(contentPath, platformDistPath, { recursive: true });
fs.cpSync(sourcePath, platformDistPath, { recursive: true });
fs.cpSync(staticPath, platformDistPath, { recursive: true });
fs.cpSync(sourcePath, platformSourceDistPath, { recursive: true });

// Copy manifest and replacing the version.
let manifest = fs.readFileSync(platformManifestPath, 'utf8');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instagram-video-control",
"version": "1.0.2",
"version": "1.1.0",
"description": "Adds volume and play controls to Instagram videos.",
"devDependencies": {
"@types/archiver": "^6.0.2",
Expand All @@ -18,8 +18,8 @@
},
"scripts": {
"build": "npm run compile && npm run pack",
"lint": "eslint ./src",
"pack": "node pack.js",
"lint": "eslint ./src/ts",
"pack": "node ./pack.js",
"compile": "webpack"
},
"repository": {
Expand Down
42 changes: 42 additions & 0 deletions src/manifest/chrome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"manifest_version": 3,
"name": "Video Control for Instagram",
"version": "{VERSION}",

"description": "Adds volume and play controls to Instagram videos.",
"author": "[email protected]",
"homepage_url": "https://github.com/Arcus92/instagram-video-control/",
"default_locale": "en",

"icons": {
"48": "icons/dark/icon-48.png",
"64": "icons/dark/icon-64.png",
"128": "icons/dark/icon-128.png"
},
"content_scripts": [
{
"matches": ["*://*.instagram.com/*"],
"js": ["js/instagram.js"],
"css": ["styles/instagram.css"],
"all_frames": true
}
],
"action": {
"default_title": "__MSG_settings__",
"default_popup": "html/popup.html",
"default_icon": {
"16": "icons/dark/icon-16.png",
"32": "icons/dark/icon-32.png"
},
"theme_icons": [{
"light": "icons/light/icon-16.png",
"dark": "icons/dark/icon-16.png",
"size": 16
},{
"light": "icons/light/icon-32.png",
"dark": "icons/dark/icon-32.png",
"size": 32
}]
},
"permissions": ["storage"]
}
47 changes: 47 additions & 0 deletions src/manifest/firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"manifest_version": 2,
"name": "Video Control for Instagram",
"version": "{VERSION}",

"description": "Adds volume and play controls to Instagram videos.",
"author": "[email protected]",
"homepage_url": "https://github.com/Arcus92/instagram-video-control/",
"default_locale": "en",

"icons": {
"48": "icons/dark/icon-48.png",
"64": "icons/dark/icon-64.png",
"128": "icons/dark/icon-128.png"
},
"content_scripts": [
{
"matches": ["*://*.instagram.com/*"],
"js": ["js/instagram.js"],
"css": ["styles/instagram.css"],
"all_frames": true
}
],
"browser_action": {
"default_title": "__MSG_settings__",
"default_popup": "html/popup.html",
"default_icon": {
"16": "icons/dark/icon-16.png",
"32": "icons/dark/icon-32.png"
},
"theme_icons": [{
"light": "icons/light/icon-16.png",
"dark": "icons/dark/icon-16.png",
"size": 16
},{
"light": "icons/light/icon-32.png",
"dark": "icons/dark/icon-32.png",
"size": 32
}]
},
"permissions": ["storage"],
"browser_specific_settings": {
"gecko": {
"id": "{a831defa-a6c9-4ca9-9593-9ccaf98462d9}"
}
}
}
38 changes: 0 additions & 38 deletions src/settings.ts

This file was deleted.

23 changes: 23 additions & 0 deletions src/static/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"settings": {
"message": "Settings"
},
"option_show_time_code": {
"message": "Show time code"
},
"option_show_fullscreen": {
"message": "Show fullscreen button"
},
"option_show_playback_speed": {
"message": "Show playback speed button"
},
"option_show_picture_in_picture": {
"message": "Show Picture-in-Picture button"
},
"view_on_github": {
"message": "View on GitHub"
},
"report_an_issue": {
"message": "Report an Issue"
}
}
Loading

0 comments on commit 8466aaf

Please sign in to comment.