()
| 4044 | var reload = (request.reload == undefined || request.reload == true); |
| 4045 | |
| 4046 | var nextStep = function() { |
| 4047 | if (request.reorder) { |
| 4048 | reorderScripts(); |
| 4049 | } |
| 4050 | |
| 4051 | if (V) console.log("modifyScriptOptions " + optionstab); |
| 4052 | if (reload) { |
| 4053 | if (optionstab) { // options page |
| 4054 | var done = function(allitems) { |
| 4055 | sendResponse({ items: allitems, i18n: Config.values.i18n }); |
| 4056 | }; |
| 4057 | createOptionItems(done); |
| 4058 | } else { // action page |
| 4059 | // update options page, in case a script was en/disabled |
| 4060 | if (request.name) window.setTimeout(notifyOptionsTab, 100); |
| 4061 | |
| 4062 | var resp = function(tab) { |
| 4063 | // TODO: use allURLs[tid].scripts instead of getting them again? |
| 4064 | var items = createActionMenuItems(tab); |
| 4065 | sendResponse({ items: items, i18n: Config.values.i18n }); |
| 4066 | if (request.name && Config.values.autoReload) { |
| 4067 | chrome.tabs.sendMessage(tab.id, |
| 4068 | { method: "reload" }, |
| 4069 | function(response) {}); |
| 4070 | } |
| 4071 | }; |
| 4072 | chrome.tabs.getSelected(null, resp); |
| 4073 | } |
| 4074 | } else { |
| 4075 | sendResponse({}); |
| 4076 | } |
| 4077 | }; |
| 4078 | |
| 4079 | if (request.name && request.method == "modifyScriptOptions") { |
| 4080 | var r = loadScriptByName(request.name); |
no test coverage detected
searching dependent graphs…