* Get the data.
()
| 112 | * Get the data. |
| 113 | */ |
| 114 | function getData() { |
| 115 | browser.runtime.sendMessage({ |
| 116 | function: "getData", |
| 117 | params: ["badged_color"] |
| 118 | }).then(data => { |
| 119 | settings["badged_color"] = data.response; |
| 120 | pickr.setColor(data.response, false); |
| 121 | }).catch(handleError); |
| 122 | |
| 123 | loadData("ruleURL") |
| 124 | .then(() => loadData("hashURL")) |
| 125 | .then(() => loadData("types")) |
| 126 | .then(() => loadData("logLimit")) |
| 127 | .then(logData => { |
| 128 | if (logData.response === undefined) { |
| 129 | document.getElementById('logLimit_label').textContent = translate('setting_log_limit_label', "0"); |
| 130 | } else { |
| 131 | document.getElementById('logLimit_label').textContent = translate('setting_log_limit_label', logData.response); |
| 132 | } |
| 133 | }).catch(handleError); |
| 134 | |
| 135 | loadData("contextMenuEnabled") |
| 136 | .then(() => loadData("historyListenerEnabled")) |
| 137 | .then(() => loadData("localHostsSkipping")) |
| 138 | .then(() => loadData("referralMarketing")) |
| 139 | .then(() => loadData("domainBlocking")) |
| 140 | .then(() => loadData("pingBlocking")) |
| 141 | .then(() => loadData("eTagFiltering")) |
| 142 | .then(() => { |
| 143 | changeSwitchButton("localHostsSkipping", "localHostsSkipping"); |
| 144 | changeSwitchButton("historyListenerEnabled", "historyListenerEnabled"); |
| 145 | changeSwitchButton("contextMenuEnabled", "contextMenuEnabled"); |
| 146 | changeSwitchButton("referralMarketing", "referralMarketing"); |
| 147 | changeSwitchButton("domainBlocking", "domainBlocking"); |
| 148 | changeSwitchButton("pingBlocking", "pingBlocking"); |
| 149 | changeSwitchButton("eTagFiltering", "eTagFiltering"); |
| 150 | }) |
| 151 | .then(() => { |
| 152 | /** |
| 153 | * Since Firefox 85, eTags can no longer be |
| 154 | * used for tracking users over multiple sites. |
| 155 | */ |
| 156 | browser.runtime.sendMessage({ |
| 157 | function: "getBrowser", |
| 158 | params: [] |
| 159 | }).then(resp => { |
| 160 | if(resp.response === "Firefox") { |
| 161 | document.getElementById('etag_p').remove(); |
| 162 | } |
| 163 | }, null); |
| 164 | }).catch(handleError); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Loads data from storage and saves into local variable. |
no test coverage detected