1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Show options page on install or update

But only when pageAction is not available (i.e. Fennec)
This commit is contained in:
kkapsner 2018-01-08 17:07:46 +01:00
parent 77e079e5cc
commit 2b92481004
6 changed files with 44 additions and 12 deletions

View file

@ -44,11 +44,15 @@
introduction.textContent = browser.i18n.getMessage("optionsIntroduction");
head.appendChild(introduction);
if (window.location.search === "?installed"){
let bookmarkingNotice = document.createElement("div");
bookmarkingNotice.className = "installedNotice";
bookmarkingNotice.textContent = browser.i18n.getMessage("installedNotice");
head.appendChild(bookmarkingNotice);
if (window.location.search){
let noticeName = window.location.search.substr(1).trim() + "Notice";
let notice = browser.i18n.getMessage(noticeName);
if (notice){
let bookmarkingNotice = document.createElement("div");
bookmarkingNotice.className = noticeName + " bookmarkNotice";
bookmarkingNotice.textContent = notice;
head.appendChild(bookmarkingNotice);
}
}
document.body.appendChild(head);