| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 }, | 550 }, |
| 551 remove: function(key, callback) | 551 remove: function(key, callback) |
| 552 { | 552 { |
| 553 chrome.storage.local.remove(key, callback); | 553 chrome.storage.local.remove(key, callback); |
| 554 }, | 554 }, |
| 555 onChanged: chrome.storage.onChanged | 555 onChanged: chrome.storage.onChanged |
| 556 }; | 556 }; |
| 557 | 557 |
| 558 /* Options */ | 558 /* Options */ |
| 559 | 559 |
| 560 ext.showOptions = function(callback) | 560 ext.showOptions = function(newOptionsPage, callback) |
| 561 { | 561 { |
| 562 chrome.windows.getLastFocused(function(win) | 562 chrome.windows.getLastFocused(function(win) |
| 563 { | 563 { |
| 564 var optionsUrl = chrome.extension.getURL("options.html"); | 564 var optionsUrl = chrome.extension.getURL( |
| 565 newOptionsPage ? "new-options.html" : "options.html" |
| 566 ); |
| 565 var queryInfo = {url: optionsUrl}; | 567 var queryInfo = {url: optionsUrl}; |
| 566 | 568 |
| 567 // extension pages can't be accessed in incognito windows. In order to | 569 // extension pages can't be accessed in incognito windows. In order to |
| 568 // correctly mimic the way in which Chrome opens extension options, | 570 // correctly mimic the way in which Chrome opens extension options, |
| 569 // we have to focus the options page in any other window. | 571 // we have to focus the options page in any other window. |
| 570 if (!win.incognito) | 572 if (!win.incognito) |
| 571 queryInfo.windowId = win.id; | 573 queryInfo.windowId = win.id; |
| 572 | 574 |
| 573 chrome.tabs.query(queryInfo, function(tabs) | 575 chrome.tabs.query(queryInfo, function(tabs) |
| 574 { | 576 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 594 ext.windows = { | 596 ext.windows = { |
| 595 create: function(createData, callback) | 597 create: function(createData, callback) |
| 596 { | 598 { |
| 597 chrome.windows.create(createData, function(createdWindow) | 599 chrome.windows.create(createData, function(createdWindow) |
| 598 { | 600 { |
| 599 afterTabLoaded(callback)(createdWindow.tabs[0]); | 601 afterTabLoaded(callback)(createdWindow.tabs[0]); |
| 600 }); | 602 }); |
| 601 } | 603 } |
| 602 }; | 604 }; |
| 603 })(); | 605 })(); |
| OLD | NEW |