adnbn
Version:
Addon Bone - Cross-browser web extension framework with shared code base
29 lines • 632 B
JavaScript
import { getUrl } from "@addon-core/browser";
const definePage = (options) => {
return options;
};
const getPages = () => {
const pages = /* @__PURE__ */ new Map();
try {
Object.entries(__ADNBN_PAGE_ALIAS__).forEach(([key, value]) => {
pages.set(key, value);
});
} catch (e) {
console.error("Failed getting pages: ", e);
}
return pages;
};
const getPageUrl = (alias) => {
let path = getPages().get(alias);
if (!path) {
console.warn(`Cannot find page: ${alias}`);
path = alias;
}
return getUrl(path);
};
export {
definePage,
getPageUrl,
getPages
};
//# sourceMappingURL=page.js.map