Skip to content

Commit

Permalink
Fixes for #108 #107 #106 #102
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-dolkens committed Jan 17, 2023
1 parent 5dc3019 commit 9a0e8f8
Show file tree
Hide file tree
Showing 46 changed files with 1,843 additions and 64 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ publish
*.xpi
*.crx
package-lock.json


.DS_Store
xcuserdata
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var JSZip = require('jszip');

var support = [ 'chrome', 'firefox', 'edge' ];

var manifest_master = JSON.parse(fs.readFileSync('src/manifest.json', 'utf8'));
var manifest_master = JSON.parse(fs.readFileSync('src/manifest.core.json', 'utf8'));

manifest_master.version = process.argv[2];

Expand Down
8 changes: 4 additions & 4 deletions src/content_scripts/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
var templates = [ ];

for (var i = 0, j = styles.length; i < j; i++) {
var styleURL = chrome.extension.getURL(styles[i]);
var styleURL = chrome.runtime.getURL(styles[i]);
console.log('Loading', styleURL);
var style = document.createElement('link');
style.id = namespace + '-css-' + i;
Expand All @@ -65,7 +65,7 @@
}

for (i = 0, j = templates.length; i < j; i++) {
var templateURL = chrome.extension.getURL(templates[i].url);
var templateURL = chrome.runtime.getURL(templates[i].url);
console.log('Loading', templateURL);
var template = document.createElement('script');
template.id = templates[i].id;
Expand Down Expand Up @@ -93,7 +93,7 @@
});

for (i = 0, j = ajax.length; i < j; i++) {
var ajaxURL = chrome.extension.getURL(ajax[i]);
var ajaxURL = chrome.runtime.getURL(ajax[i]);
console.log('Loading', ajaxURL);
var script = document.createElement('script');
script.id = (namespace + '-ajax-' + ajax[i++]).replace('web_resources/', '').replace(/[. ]/, '-');
Expand All @@ -107,7 +107,7 @@
var loadScript = function() {
if (scripts.length == 0) return;

var scriptURL = chrome.extension.getURL(scripts.pop());
var scriptURL = chrome.runtime.getURL(scripts.pop());
console.log('Loading', scriptURL);
var script = document.createElement('script');
script.id = namespace + '-js-' + i++;
Expand Down
1 change: 0 additions & 1 deletion src/manifest.chrome.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{

}
88 changes: 88 additions & 0 deletions src/manifest.core.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"description": "This extension improves the Hangar page on RobertsSpaceIndustries.com",
"name": "Star Citizen Hangar XPLORer",
"short_name": "HangarXPLOR",
"version": "0.0.0.1",
"author": "/u/alluran (Peter Dolkens)",
"icons": {
"128": "icons/icon_128.png"
},
"manifest_version": 3,
"permissions": [
"storage",
"unlimitedStorage"
],
"host_permissions": [
"https://robertsspaceindustries.com/*",
"https://www.robertsspaceindustries.com/*"
],
"action": {
"default_icon": {
"48": "icons/icon_48-fill.png",
"128": "icons/icon_128-fill.png"
},
"default_popup": "ui_resources/HangarXPLOR.Settings.html"
},
"content_scripts": [
{
"matches": [
"https://robertsspaceindustries.com/account/pledges*",
"https://www.robertsspaceindustries.com/account/pledges*"
],
"js": [
"content_scripts/loader.js"
],
"run_at": "document_end"
}
],
"web_accessible_resources": [
{
"matches": [
"https://robertsspaceindustries.com/*",
"https://www.robertsspaceindustries.com/*"
],
"resources": [
"web_resources/ship-codes.json",
"web_resources/shims.chrome.storage.js",
"web_resources/fuse.min.js",
"web_resources/HangarXPLOR.BulkUI.js",
"web_resources/HangarXPLOR.Button.js",
"web_resources/HangarXPLOR.Components.js",
"web_resources/HangarXPLOR.DrawUI.js",
"web_resources/HangarXPLOR.Download.js",
"web_resources/HangarXPLOR.Dropdown.js",
"web_resources/HangarXPLOR.Filter.js",
"web_resources/HangarXPLOR.LoadPage.js",
"web_resources/HangarXPLOR.LoadCache.js",
"web_resources/HangarXPLOR.LoadSettings.js",
"web_resources/HangarXPLOR.Log.js",
"web_resources/HangarXPLOR.Pager.js",
"web_resources/HangarXPLOR.ParseComponent.js",
"web_resources/HangarXPLOR.ParseCoupon.js",
"web_resources/HangarXPLOR.ParseDecoration.js",
"web_resources/HangarXPLOR.ParseEquipment.js",
"web_resources/HangarXPLOR.ParseHangar.js",
"web_resources/HangarXPLOR.ParsePledge.js",
"web_resources/HangarXPLOR.ParseReward.js",
"web_resources/HangarXPLOR.ParseShip.js",
"web_resources/HangarXPLOR.ParseSkin.js",
"web_resources/HangarXPLOR.ParseUpgrade.js",
"web_resources/HangarXPLOR.PreProcess.js",
"web_resources/HangarXPLOR.ProcessPage.js",
"web_resources/HangarXPLOR.Render.js",
"web_resources/HangarXPLOR.SaveCache.js",
"web_resources/HangarXPLOR.SaveSettings.js",
"web_resources/HangarXPLOR.Search.js",
"web_resources/HangarXPLOR.SearchBox.js",
"web_resources/HangarXPLOR.Ships.js",
"web_resources/HangarXPLOR.Sort.js",
"web_resources/HangarXPLOR.Templates.js",
"web_resources/HangarXPLOR.Toggle.js",
"web_resources/HangarXPLOR.Debug.js",
"web_resources/HangarXPLOR.js",
"web_resources/HangarXPLOR.css",
"debug/*.html"
]
}
]
}
1 change: 1 addition & 0 deletions src/manifest.edge.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"manifest_version": 2,
"-ms-preload": {
"backgroundScript": "vendor/edge/backgroundScriptsAPIBridge.js",
"contentScript": "vendor/edge/contentScriptsAPIBridge.js"
Expand Down
6 changes: 6 additions & 0 deletions src/manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"gecko": {
"id": "[email protected]"
}
},

"browser_specific_settings": {
"gecko": {
"id": "[email protected]"
}
}
}
139 changes: 82 additions & 57 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,94 @@
{
"description": "This extension improves the Hangar page on RobertsSpaceIndustries.com",
"manifest_version": 2,
"name": "Star Citizen Hangar XPLORer",
"short_name": "HangarXPLOR",
"version": "0.0.0.1",

"author": "/u/alluran (Peter Dolkens)",

"permissions": [ "https://robertsspaceindustries.com/*", "storage" ],

"icons": {
"128": "icons/icon_128.png"
},
"browser_action": {
"default_icon": {
"48": "icons/icon_48-fill.png",
"128": "icons/icon_128-fill.png"
},
"default_popup": "ui_resources/HangarXPLOR.Settings.html"
"manifest_version": 3,
"permissions": [
"storage",
"unlimitedStorage"
],
"host_permissions": [
"https://robertsspaceindustries.com/*",
"https://www.robertsspaceindustries.com/*"
],
"action": {
"default_icon": {
"48": "icons/icon_48-fill.png",
"128": "icons/icon_128-fill.png"
},
"default_popup": "ui_resources/HangarXPLOR.Settings.html"
},
"content_scripts": [{
"matches": ["https://robertsspaceindustries.com/account/pledges*", "https://www.robertsspaceindustries.com/account/pledges*"],
"js": ["content_scripts/loader.js"],
"run_at": "document_end"
}],
"content_scripts": [
{
"matches": [
"https://robertsspaceindustries.com/account/pledges*",
"https://www.robertsspaceindustries.com/account/pledges*"
],
"js": [
"content_scripts/loader.js"
],
"run_at": "document_end"
}
],
"web_accessible_resources": [
"web_resources/ship-codes.json",
"web_resources/shims.chrome.storage.js",
"web_resources/fuse.min.js",
"web_resources/HangarXPLOR.BulkUI.js",
"web_resources/HangarXPLOR.Button.js",
"web_resources/HangarXPLOR.Components.js",
"web_resources/HangarXPLOR.DrawUI.js",
"web_resources/HangarXPLOR.Download.js",
"web_resources/HangarXPLOR.Dropdown.js",
"web_resources/HangarXPLOR.Filter.js",
"web_resources/HangarXPLOR.LoadPage.js",
"web_resources/HangarXPLOR.LoadCache.js",
"web_resources/HangarXPLOR.LoadSettings.js",
"web_resources/HangarXPLOR.Log.js",
"web_resources/HangarXPLOR.Pager.js",
"web_resources/HangarXPLOR.ParseComponent.js",
"web_resources/HangarXPLOR.ParseCoupon.js",
"web_resources/HangarXPLOR.ParseDecoration.js",
"web_resources/HangarXPLOR.ParseEquipment.js",
"web_resources/HangarXPLOR.ParseHangar.js",
"web_resources/HangarXPLOR.ParsePledge.js",
"web_resources/HangarXPLOR.ParseReward.js",
"web_resources/HangarXPLOR.ParseShip.js",
"web_resources/HangarXPLOR.ParseSkin.js",
"web_resources/HangarXPLOR.ParseUpgrade.js",
"web_resources/HangarXPLOR.PreProcess.js",
"web_resources/HangarXPLOR.ProcessPage.js",
"web_resources/HangarXPLOR.Render.js",
"web_resources/HangarXPLOR.SaveCache.js",
"web_resources/HangarXPLOR.SaveSettings.js",
"web_resources/HangarXPLOR.Search.js",
"web_resources/HangarXPLOR.SearchBox.js",
"web_resources/HangarXPLOR.Ships.js",
"web_resources/HangarXPLOR.Sort.js",
"web_resources/HangarXPLOR.Templates.js",
"web_resources/HangarXPLOR.Toggle.js",
"web_resources/HangarXPLOR.Debug.js",
"web_resources/HangarXPLOR.js",
"web_resources/HangarXPLOR.css",
"debug/*.html"
]
{
"matches": [
"https://robertsspaceindustries.com/*",
"https://www.robertsspaceindustries.com/*"
],
"resources": [
"web_resources/ship-codes.json",
"web_resources/shims.chrome.storage.js",
"web_resources/fuse.min.js",
"web_resources/HangarXPLOR.BulkUI.js",
"web_resources/HangarXPLOR.Button.js",
"web_resources/HangarXPLOR.Components.js",
"web_resources/HangarXPLOR.DrawUI.js",
"web_resources/HangarXPLOR.Download.js",
"web_resources/HangarXPLOR.Dropdown.js",
"web_resources/HangarXPLOR.Filter.js",
"web_resources/HangarXPLOR.LoadPage.js",
"web_resources/HangarXPLOR.LoadCache.js",
"web_resources/HangarXPLOR.LoadSettings.js",
"web_resources/HangarXPLOR.Log.js",
"web_resources/HangarXPLOR.Pager.js",
"web_resources/HangarXPLOR.ParseComponent.js",
"web_resources/HangarXPLOR.ParseCoupon.js",
"web_resources/HangarXPLOR.ParseDecoration.js",
"web_resources/HangarXPLOR.ParseEquipment.js",
"web_resources/HangarXPLOR.ParseHangar.js",
"web_resources/HangarXPLOR.ParsePledge.js",
"web_resources/HangarXPLOR.ParseReward.js",
"web_resources/HangarXPLOR.ParseShip.js",
"web_resources/HangarXPLOR.ParseSkin.js",
"web_resources/HangarXPLOR.ParseUpgrade.js",
"web_resources/HangarXPLOR.PreProcess.js",
"web_resources/HangarXPLOR.ProcessPage.js",
"web_resources/HangarXPLOR.Render.js",
"web_resources/HangarXPLOR.SaveCache.js",
"web_resources/HangarXPLOR.SaveSettings.js",
"web_resources/HangarXPLOR.Search.js",
"web_resources/HangarXPLOR.SearchBox.js",
"web_resources/HangarXPLOR.Ships.js",
"web_resources/HangarXPLOR.Sort.js",
"web_resources/HangarXPLOR.Templates.js",
"web_resources/HangarXPLOR.Toggle.js",
"web_resources/HangarXPLOR.Debug.js",
"web_resources/HangarXPLOR.js",
"web_resources/HangarXPLOR.css",
"debug/*.html"
]
}
],

"browser_specific_settings": {
"gecko": {
"id": "[email protected]"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 9a0e8f8

Please sign in to comment.