mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-19 18:07:58 +01:00
Fix initialization from XPI.
This commit is contained in:
@@ -177,6 +177,10 @@ xpi: $(CHROME)
|
||||
-f $(BASE)/process_manifest.awk \
|
||||
"$(TOP)/chrome.manifest" >"$(XPI_PATH)/chrome.manifest"
|
||||
|
||||
$(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \
|
||||
-f $(BASE)/process_config.awk \
|
||||
"$(TOP)/config.json" >"$(XPI_PATH)/config.json"
|
||||
|
||||
version="$(VERSION)"; \
|
||||
hg root >/dev/null 2>&1 && \
|
||||
case "$$version" in \
|
||||
|
||||
4
common/bootstrap.js
vendored
4
common/bootstrap.js
vendored
@@ -309,7 +309,9 @@ function updateVersion() {
|
||||
// Disable automatic updates when switching to nightlies,
|
||||
// restore the default action when switching to stable.
|
||||
if (!config.lastVersion || isDev(config.lastVersion) != isDev(addon.version))
|
||||
addon.applyBackgroundUpdates = AddonManager[isDev(addon.version) ? "AUTOUPDATE_DISABLE" : "AUTOUPDATE_DEFAULT"];
|
||||
addon.applyBackgroundUpdates =
|
||||
AddonManager[isDev(addon.version) ? "AUTOUPDATE_DISABLE"
|
||||
: "AUTOUPDATE_DEFAULT"];
|
||||
}
|
||||
catch (e) {
|
||||
reportError(e);
|
||||
|
||||
22
common/process_config.awk
Normal file
22
common/process_config.awk
Normal file
@@ -0,0 +1,22 @@
|
||||
BEGIN {
|
||||
chrome = "chrome"
|
||||
if (suffix)
|
||||
chrome = suffix
|
||||
}
|
||||
/^ \}/ { on = 0 }
|
||||
|
||||
on && $NF ~ /^"([a-z]|\.\/)/ {
|
||||
$NF = "\"/" name "/" substr($NF, 2)
|
||||
}
|
||||
/./ && on {
|
||||
sub(/^"\.\./, "\"", $NF);
|
||||
$NF = "\"" chrome substr($NF, 2)
|
||||
}
|
||||
/./ && on {
|
||||
gsub(/\/\.\//, "/")
|
||||
sub(/^\"\.\.\/common\//, "\"", $NF)
|
||||
$0 = " " $0
|
||||
}
|
||||
//
|
||||
|
||||
/^ "resources": \{/ { on = 1 }
|
||||
@@ -3,8 +3,12 @@ BEGIN {
|
||||
if (suffix)
|
||||
chrome = suffix
|
||||
}
|
||||
|
||||
{ content = $1 ~ /^(content|skin|locale|resource)$/ }
|
||||
content && $NF ~ /^[a-z]|^\.\// { $NF = "/" name "/" $NF }
|
||||
|
||||
content && $NF ~ /^([a-z]|\.\/)/ {
|
||||
$NF = "/" name "/" $NF
|
||||
}
|
||||
content {
|
||||
sub(/^\.\./, "", $NF);
|
||||
if (isjar)
|
||||
|
||||
Reference in New Issue
Block a user