| Index: chrome/content/ui/composer.js |
| =================================================================== |
| --- a/chrome/content/ui/composer.js |
| +++ b/chrome/content/ui/composer.js |
| @@ -10,23 +10,24 @@ |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| * GNU General Public License for more details. |
| * |
| * You should have received a copy of the GNU General Public License |
| * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| */ |
| -var nodes = null; |
| +var nodesID = null; |
| var item = null; |
| var advancedMode = false; |
| function init() |
| { |
| - [nodes, item] = window.arguments; |
| + [nodesID, item] = window.arguments; |
| + window.addEventListener("unload", () => Policy.deleteNodes(nodesID)); |
| E("filterType").value = (!item.filter || item.filter.disabled || item.filter instanceof WhitelistFilter ? "filterlist" : "whitelist"); |
| E("customPattern").value = item.location; |
| let insertionPoint = E("customPatternBox"); |
| let addSuggestion = function(address) |
| { |
| // Always drop protocol and www. from the suggestion |
| @@ -336,18 +337,18 @@ function updateCustomPattern() |
| } |
| function addFilter() { |
| let filter = Filter.fromText(document.getElementById("filter").value); |
| filter.disabled = false; |
| FilterStorage.addFilter(filter); |
| - if (nodes) |
| - Policy.refilterNodes(nodes, item); |
| + if (nodesID) |
| + Policy.refilterNodes(nodesID, item); |
| return true; |
| } |
| function setAdvancedMode(mode) { |
| advancedMode = mode; |
| var dialog = document.documentElement; |