Put content scripts and injections inside folders
In order to clean up the src directory and explain implicitly clearer
what each script/stylesheet is.
Change-Id: I72f1d82a3806f99fa3322d5a3157289d23213299
diff --git a/src/console_inject.js b/src/content_scripts/console_inject.js
similarity index 92%
rename from src/console_inject.js
rename to src/content_scripts/console_inject.js
index 8858baf..62768bd 100644
--- a/src/console_inject.js
+++ b/src/content_scripts/console_inject.js
@@ -116,9 +116,10 @@
}
if (options.profileindicator) {
- injectScript(chrome.runtime.getURL('console_profileindicator_inject.js'));
- injectStylesheet(
- chrome.runtime.getURL('console_profileindicator_inject.css'));
+ injectScript(
+ chrome.runtime.getURL('injections/console_profileindicator_inject.js'));
+ injectStylesheet(chrome.runtime.getURL(
+ 'injections/console_profileindicator_inject.css'));
// In order to pass i18n strings to the injected script, which doesn't have
// access to the chrome.i18n API.
@@ -128,7 +129,8 @@
string: chrome.i18n.getMessage(request.msg),
requestId: request.id
};
- window.dispatchEvent(new CustomEvent('sendi18nString', {detail: response}));
+ window.dispatchEvent(
+ new CustomEvent('sendi18nString', {detail: response}));
});
}
});
diff --git a/src/console_inject_start.js b/src/content_scripts/console_inject_start.js
similarity index 100%
rename from src/console_inject_start.js
rename to src/content_scripts/console_inject_start.js
diff --git a/src/forum_inject.js b/src/content_scripts/forum_inject.js
similarity index 100%
rename from src/forum_inject.js
rename to src/content_scripts/forum_inject.js
diff --git a/src/profile_inject.js b/src/content_scripts/profile_inject.js
similarity index 100%
rename from src/profile_inject.js
rename to src/content_scripts/profile_inject.js
diff --git a/src/thread_inject.js b/src/content_scripts/thread_inject.js
similarity index 100%
rename from src/thread_inject.js
rename to src/content_scripts/thread_inject.js
diff --git a/src/console_profileindicator_inject.css b/src/injections/console_profileindicator_inject.css
similarity index 100%
rename from src/console_profileindicator_inject.css
rename to src/injections/console_profileindicator_inject.css
diff --git a/src/console_profileindicator_inject.js b/src/injections/console_profileindicator_inject.js
similarity index 100%
rename from src/console_profileindicator_inject.js
rename to src/injections/console_profileindicator_inject.js
diff --git a/templates/manifest.gjson b/templates/manifest.gjson
index cfb5ff1..39d0804 100644
--- a/templates/manifest.gjson
+++ b/templates/manifest.gjson
@@ -13,25 +13,25 @@
"content_scripts": [
{
"matches": ["https://support.google.com/s/community*"],
- "js": ["console_inject.js"]
+ "js": ["content_scripts/console_inject.js"]
},
{
"matches": ["https://support.google.com/s/community*"],
- "js": ["console_inject_start.js"],
+ "js": ["content_scripts/console_inject_start.js"],
"run_at": "document_start"
},
{
"matches": ["https://support.google.com/*/threads*"],
- "js": ["forum_inject.js"]
+ "js": ["content_scripts/forum_inject.js"]
},
{
"matches": ["https://support.google.com/*/thread/*"],
- "js": ["thread_inject.js"],
+ "js": ["content_scripts/thread_inject.js"],
"run_at": "document_end"
},
{
"matches": ["https://support.google.com/*/profile/*"],
- "js": ["profile_inject.js"]
+ "js": ["content_scripts/profile_inject.js"]
}
],
"permissions": [
@@ -41,8 +41,8 @@
"storage"
],
"web_accessible_resources": [
- "console_profileindicator_inject.js",
- "console_profileindicator_inject.css"
+ "injections/console_profileindicator_inject.js",
+ "injections/console_profileindicator_inject.css"
],
"browser_action": {},
#if defined(CHROMIUM)