diff --git a/src/extension/manifest.json b/src/extension/manifest.json index e6de158..7a7c783 100644 --- a/src/extension/manifest.json +++ b/src/extension/manifest.json @@ -1,10 +1,9 @@ { "manifest_version": 2, "name": "__MSG_title__", - "version": "0.9.8", + "version": "0.9.9", "author": "Adobe", "homepage_url": "https://www.hlx.live/tools/sidekick/", - "update_url": "https://www.hlx.live/tools/sidekick/extension.xml", "default_locale": "en", "options_page": "options.html", "description": "__MSG_description__", diff --git a/src/extension/utils.js b/src/extension/utils.js index f344344..f286327 100644 --- a/src/extension/utils.js +++ b/src/extension/utils.js @@ -172,10 +172,12 @@ async function getProjectConfig(owner, repo, ref) { const res = await fetch(configJS); if (res.ok) { const js = await res.text(); - const [, host] = /host: ?["']{1}(.*)['"]{1}/.exec(js) || []; - if (host) { - cfg.host = host; - } + ['project', 'host', 'outerHost'].forEach((prop) => { + const [, value] = new RegExp(`${prop}: ?["']{1}(.*)['"]{1}`).exec(js) || []; + if (value) { + cfg[prop] = value; + } + }); } return cfg; } @@ -186,15 +188,21 @@ export async function assembleConfig({ hlx3, project, host, + outerHost, devMode, }) { const { owner, repo, ref } = getGitHubSettings(giturl); const projectConfig = await getProjectConfig(owner, repo, ref); + // allow local project config overrides + project = project || projectConfig.project; + host = host || projectConfig.host; + outerHost = outerHost || projectConfig.outerHost; + return { id: `${owner}/${repo}/${ref}`, - ...projectConfig, project, host, + outerHost, hlx3, devMode, giturl,