Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: safari/ext/background.js

Issue 5466750908891136: Reset browser actions on Safari while the tab is loading (Closed)
Patch Set: Created Jan. 23, 2014, 10:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 { 266 {
267 var property = toolbarItemProperties[name]; 267 var property = toolbarItemProperties[name];
268 268
269 if (property.tabs.has(tab)) 269 if (property.tabs.has(tab))
270 toolbarItem[name] = property.tabs.get(tab); 270 toolbarItem[name] = property.tabs.get(tab);
271 else 271 else
272 toolbarItem[name] = property.global; 272 toolbarItem[name] = property.global;
273 } 273 }
274 }); 274 });
275 275
276 ext.tabs.onLoading.addListener(function(tab)
277 {
278 var currentWindow = tab._tab.browserWindow;
279
280 var toolbarItem;
281 if (tab._tab == currentWindow.activeTab)
282 toolbarItem = getToolbarItemForWindow(currentWindow);
283 else
284 toolbarItem = null;
285
286 for (var name in toolbarItemProperties)
287 {
288 var property = toolbarItemProperties[name];
289 property.tabs.delete(tab);
290
291 if (toolbarItem)
292 toolbarItem[name] = property.global;
293 }
294 });
295
276 296
277 /* Windows */ 297 /* Windows */
278 298
279 Window = function(win) 299 Window = function(win)
280 { 300 {
281 this._win = win; 301 this._win = win;
282 } 302 }
283 Window.prototype = { 303 Window.prototype = {
284 get visible() 304 get visible()
285 { 305 {
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 for (var i = 0; i < contextMenuItems.length; i++) 705 for (var i = 0; i < contextMenuItems.length; i++)
686 { 706 {
687 if (contextMenuItems[i].id == event.command) 707 if (contextMenuItems[i].id == event.command)
688 { 708 {
689 contextMenuItems[i].onclick(event.userInfo.srcUrl, new Tab(safari.applic ation.activeBrowserWindow.activeTab)); 709 contextMenuItems[i].onclick(event.userInfo.srcUrl, new Tab(safari.applic ation.activeBrowserWindow.activeTab));
690 break; 710 break;
691 } 711 }
692 } 712 }
693 }, false); 713 }, false);
694 })(); 714 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld