Sessions.js 846 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. exports["setTabValueImpl"] = function(tabId, key, value) {
  3. return browser.sessions.setTabValue(tabId, key, value);
  4. };
  5. exports["removeTabValueImpl"] = function(tabId, key) {
  6. return browser.sessions.removeTabValue(tabId, key);
  7. };
  8. exports["getTabValueImpl"] = function(Just, Nothing, tabId, key) {
  9. return browser.sessions.getTabValue(tabId, key).then(val => {
  10. if (val === undefined) return Nothing;
  11. else return Just(val);
  12. });
  13. };
  14. exports["setWindowValueImpl"] = function(windowId, key, value) {
  15. return browser.sessions.setWindowValue(windowId, key, value);
  16. };
  17. exports["removeWindowValueImpl"] = function(windowId, key) {
  18. return browser.sessions.removeWindowValue(windowId, key);
  19. };
  20. exports["getWindowValueImpl"] = function(windowId, key) {
  21. return browser.sessions.getWindowValue(windowId, key);
  22. };