content.js 894 B

123456789101112131415161718192021222324252627282930
  1. const ___WOOKTEAM_CONTENT_OBJECT = {
  2. username: 0,
  3. interval: function () {
  4. try {
  5. var config = JSON.parse(window.localStorage.getItem("__::WookTeam:config"));
  6. if (typeof config.username === "string") {
  7. if (config.username !== ___WOOKTEAM_CONTENT_OBJECT.username) {
  8. ___WOOKTEAM_CONTENT_OBJECT.username = config.username;
  9. chrome.runtime.sendMessage({
  10. act: 'config',
  11. config: config
  12. }, function (response) {
  13. //console.log(response);
  14. });
  15. }
  16. }
  17. } catch (e) {
  18. }
  19. }
  20. };
  21. if (window.localStorage.getItem("__::WookTeam:check") === "success") {
  22. ___WOOKTEAM_CONTENT_OBJECT.interval();
  23. setInterval(___WOOKTEAM_CONTENT_OBJECT.interval, 6000);
  24. }