Remove trailing slash from ingress path
@@ -311,13 +311,13 @@ function getInnerHomeUri() {
function getOutterHomeUri() {
if (parent !== window) {
- return normalizeAddonUrl(URI(document.referrer));
+ return normalizeAddonUrl(URI(parent.location.href), false);
} else {
return getInnerHomeUri()
}
}
-function normalizeAddonUrl(uri) {
+function normalizeAddonUrl(uri, add_trailing_slash=true) {
path = uri.pathname();
endings = [
/\/reauthenticate$/g,
@@ -330,7 +330,9 @@ function normalizeAddonUrl(uri) {
for (var i = 0; i < endings.length; i++) {
path = path.replace(endings[i], "/");
}
+ if (add_trailing_slash) {
path = path + "/";
+ }
path = path.replace("//", "/");
return uri.pathname(path).search("").fragment("").hash("").toString();
}
@@ -737,3 +739,8 @@ function copyFromInput(id) {
copyText.select();
document.execCommand("copy");
}
+
+function saveFolder(id) {
+ url = "changefolder?id=" + id
+ postJson(url, {}, refreshstats, null, "Setting snapshot folder...");
+}
\ No newline at end of file
