(name, script, triggerSync)
| 3737 | }; |
| 3738 | |
| 3739 | var storeScript = function(name, script, triggerSync) { |
| 3740 | if (triggerSync === undefined) triggerSync = true; |
| 3741 | |
| 3742 | if (script) { |
| 3743 | var added = !TM_storage.getValue(name); |
| 3744 | var changed; |
| 3745 | |
| 3746 | TM_storage.setValue(name + condAppendix, { inc: script.includes, match: script.matches, exc: script.excludes }); |
| 3747 | TM_storage.setValue(name + scriptAppendix, script.textContent); |
| 3748 | var s = script; |
| 3749 | s.textContent = null; |
| 3750 | TM_storage.setValue(name, s); |
| 3751 | |
| 3752 | if (triggerSync) { |
| 3753 | if (added) { |
| 3754 | SyncClient.scriptAddedCb(name, script); |
| 3755 | } else { |
| 3756 | SyncClient.scriptChangedCb(name, script); |
| 3757 | } |
| 3758 | } |
| 3759 | } else { |
| 3760 | var r = loadScriptByName(name); |
| 3761 | |
| 3762 | TM_storage.deleteValue(name + condAppendix); |
| 3763 | TM_storage.deleteValue(name + scriptAppendix); |
| 3764 | TM_storage.deleteValue(name); |
| 3765 | |
| 3766 | if (triggerSync && r.script && r.cond) { |
| 3767 | SyncClient.scriptRemovedCb(name, r.script); |
| 3768 | } |
| 3769 | } |
| 3770 | }; |
| 3771 | |
| 3772 | var notifyStorageListeners = function(name, key, tabid, send) { |
| 3773 | if (send === undefined) send = true; |
no test coverage detected
searching dependent graphs…