Skip to content

Commit

Permalink
Updated version to v4.3.7 and small fixes #421
Browse files Browse the repository at this point in the history
- Updated version to v4.3.7
- Moved manifest to v3 as default
- Fixed manifest v3 problem
  • Loading branch information
GramThanos committed Sep 14, 2022
1 parent fccd789 commit 1ba2c4f
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 47 deletions.
15 changes: 10 additions & 5 deletions dist/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ rm -f GladiatusCrazyAddOn_Edge.zip
cd ../source

echo "Building for Chrome (Manifest v3)"
zip -q -r ../dist/GladiatusCrazyAddOn_Chrome.zip core icons init.js manifest_v3.json
printf "@ manifest_v3.json\n@=manifest.json\n" | zipnote -w ../dist/GladiatusCrazyAddOn_Chrome.zip
zip -q -r ../dist/GladiatusCrazyAddOn_Chrome.zip core icons init.js manifest.json

echo "Building for Chrome (Deprecated Manifest v2)"
zip -q -r ../dist/GladiatusCrazyAddOn_Chrome_Manifest_v2.zip core icons init.js manifest.json
zip -q -r ../dist/GladiatusCrazyAddOn_Chrome_Manifest_v2.zip core icons init.js manifest_v2.json
printf "@ manifest_v2.json\n@=manifest.json\n" | zipnote -w ../dist/GladiatusCrazyAddOn_Chrome_Manifest_v2.zip

echo "Building for Firefox (Manifest v2)"
zip -q -r ../dist/GladiatusCrazyAddOn_Firefox.zip core icons init.js manifest.json
zip -q -r ../dist/GladiatusCrazyAddOn_Firefox.zip core icons init.js manifest_v2.json
printf "@ manifest_v2.json\n@=manifest.json\n" | zipnote -w ../dist/GladiatusCrazyAddOn_Firefox.zip
mv ../dist/GladiatusCrazyAddOn_Firefox.zip ../dist/GladiatusCrazyAddOn_Firefox.xpi

echo "Building for Edge (Manifest v2)"
echo "Building for Edge (Manifest v3)"
zip -q -r ../dist/GladiatusCrazyAddOn_Edge.zip core icons init.js manifest.json

echo "Building for Edge (Deprecated Manifest v2)"
zip -q -r ../dist/GladiatusCrazyAddOn_Edge_Manifest_v2.zip core icons init.js manifest_v2.json
printf "@ manifest_v2.json\n@=manifest.json\n" | zipnote -w ../dist/GladiatusCrazyAddOn_Edge_Manifest_v2.zip

cd ../dist
18 changes: 4 additions & 14 deletions source/core/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,9 @@ var inject = function(_info, _window, _folder){
// Locale Load
locale.preload();

// Resources Load
tools.loadCode(
'\n' +
'var gca_resources = ' + JSON.stringify({
folder : _folder + '/resources/',
audio : _folder + '/resources/audio/'
}, '', '\t') + ';\n' +
'var gca_extension = ' + JSON.stringify({
id : _info.extension
}, '', '\t') + ';\n'
);

// Info
tools.preloadScript('source/gca.info.js');
tools.preloadScript('source/gca.info.js')
.setAttribute('data-id', _info.extension);
// Data - Options
tools.preloadScript('source/gca.data.js');
tools.preloadScript('source/gca.data.recipes.js');
Expand Down Expand Up @@ -75,7 +64,8 @@ var tools = {
// Create script
var script = info.data.document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.text = code;
script.setAttribute('src', URL.createObjectURL(new Blob([code], {type : 'text/javascript'})));
//script.text = code;
info.data.document.head.appendChild(script);
},

Expand Down
10 changes: 9 additions & 1 deletion source/core/source/gca.info.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ var gca = {
name : "Gladiatus Crazy Addon",
shortName : "GCA",
description: "Improve your gladiatus experience!",
version: "4.3.6",
version: "4.3.7",
developers : [
"GreatApo",
"DarkThanos"
],
homepage : "https://gladiatus.dinodevs.com"
};

var gca_extension = {
"id": document.currentScript.dataset.id
};
var gca_resources = {
"folder": "chrome-extension://" + gca_extension.id + "/core/resources/",
"audio": "chrome-extension://" + gca_extension.id + "/core/resources/audio/"
};

// Page info
var gca_section = {
// Resolve Document Url
Expand Down
2 changes: 1 addition & 1 deletion source/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var init = (function () {
inject(
info,
window,
Browser.extension.getURL('core')
(Browser?.runtime?.getURL || Browser?.extension?.getURL)('core')
);
});
})();
Expand Down
26 changes: 15 additions & 11 deletions source/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Gladiatus Crazy Add On",
"short_name": "GCA",
"version": "4.3.6",
"version": "4.3.7",
"description": "Improve your gladiatus experience!",
"author": "DinoDevs (Darkthanos, GreatApo)",
"homepage_url": "https://gladiatus.dinodevs.com",
"minimum_chrome_version": "18.0",
"minimum_chrome_version": "88.0",

"icons": {
"16": "icons/icon_16.png",
Expand All @@ -16,7 +16,6 @@
"content_scripts": [
{
"matches": [
"http://*.gladiatus.gameforge.com/game/index.php*",
"https://*.gladiatus.gameforge.com/game/index.php*"
],
"js": [
Expand All @@ -32,10 +31,7 @@
],

"background": {
"scripts": [
"core/background.js"
],
"persistent": false
"service_worker": "core/background.js"
},
"externally_connectable": {
"matches": [
Expand All @@ -45,9 +41,17 @@
},

"web_accessible_resources": [
"core/locale/*",
"core/resources/*",
"core/source/*"
{
"resources": [
"core/locale/*",
"core/resources/*",
"core/source/*",
"core/background.recipes.js"
],
"matches": [
"https://*.gladiatus.gameforge.com/*"
]
}
],
"manifest_version": 2
"manifest_version": 3
}
26 changes: 11 additions & 15 deletions source/manifest_v3.json → source/manifest_v2.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Gladiatus Crazy Add On",
"short_name": "GCA",
"version": "4.3.6",
"version": "4.3.7",
"description": "Improve your gladiatus experience!",
"author": "DinoDevs (Darkthanos, GreatApo)",
"homepage_url": "https://gladiatus.dinodevs.com",
"minimum_chrome_version": "88.0",
"minimum_chrome_version": "18.0",

"icons": {
"16": "icons/icon_16.png",
Expand All @@ -16,6 +16,7 @@
"content_scripts": [
{
"matches": [
"http://*.gladiatus.gameforge.com/game/index.php*",
"https://*.gladiatus.gameforge.com/game/index.php*"
],
"js": [
Expand All @@ -31,7 +32,10 @@
],

"background": {
"service_worker": "core/background.js"
"scripts": [
"core/background.js"
],
"persistent": false
},
"externally_connectable": {
"matches": [
Expand All @@ -41,17 +45,9 @@
},

"web_accessible_resources": [
{
"resources": [
"core/locale/*",
"core/resources/*",
"core/source/*",
"core/background.recipes.js"
],
"matches": [
"https://*.gladiatus.gameforge.com/*"
]
}
"core/locale/*",
"core/resources/*",
"core/source/*"
],
"manifest_version": 3
"manifest_version": 2
}

0 comments on commit 1ba2c4f

Please sign in to comment.