for #5: Edit Containers link to about:preferences
This commit is contained in:
parent
93fa669071
commit
e9988d2167
3 changed files with 19 additions and 6 deletions
17
index.js
17
index.js
|
@ -1,12 +1,19 @@
|
||||||
const webExtension = require('sdk/webextension');
|
|
||||||
const {ContextualIdentityService} = require('resource://gre/modules/ContextualIdentityService.jsm');
|
const {ContextualIdentityService} = require('resource://gre/modules/ContextualIdentityService.jsm');
|
||||||
|
const tabs = require('sdk/tabs');
|
||||||
|
const webExtension = require('sdk/webextension');
|
||||||
|
|
||||||
function handleWebExtensionMessage(message, sender, sendReply) {
|
function handleWebExtensionMessage(message, sender, sendReply) {
|
||||||
console.log(message);
|
console.log(message);
|
||||||
if (message === 'get-identities') {
|
switch (message) {
|
||||||
sendReply({
|
case 'get-identities':
|
||||||
content: {identities: ContextualIdentityService.getIdentities()}
|
sendReply({
|
||||||
});
|
content: {identities: ContextualIdentityService.getIdentities()}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'open-containers-preferences':
|
||||||
|
tabs.open('about:preferences#containers');
|
||||||
|
sendReply({content: 'opened'});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,3 +16,9 @@ browser.runtime.sendMessage('get-identities').then(reply=> {
|
||||||
console.log('response from sdk addon: ', reply.content);
|
console.log('response from sdk addon: ', reply.content);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.querySelector('#edit-containers-link').addEventListener('click', ()=> {
|
||||||
|
browser.runtime.sendMessage('open-containers-preferences').then(()=> {
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</table>
|
</table>
|
||||||
<div class="row popup-bumper edit-identities">
|
<div class="row popup-bumper edit-identities">
|
||||||
<div class="small-12 columns edit-containers-text">
|
<div class="small-12 columns edit-containers-text">
|
||||||
<a href="#">Edit Containers</a>
|
<a id="edit-containers-link" href="about:preferences#containers">Edit Containers</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="js/popup.js"></script>
|
<script src="js/popup.js"></script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue