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

Side by Side Diff: devtools.js

Issue 29491555: Noissue - Check if ExtensionPanel has onSearch before adding listener (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created July 18, 2017, 5:28 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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 26 matching lines...) Expand all
37 panel.onShown.addListener(window => 37 panel.onShown.addListener(window =>
38 { 38 {
39 panelWindow = window; 39 panelWindow = window;
40 }); 40 });
41 41
42 panel.onHidden.addListener(window => 42 panel.onHidden.addListener(window =>
43 { 43 {
44 panelWindow = null; 44 panelWindow = null;
45 }); 45 });
46 46
47 panel.onSearch.addListener((eventName, queryString) => 47 if (panel.onSearch)
48 { 48 {
49 if (panelWindow) 49 panel.onSearch.addListener((eventName, queryString) =>
50 panelWindow.postMessage({type: eventName, queryString}, "*"); 50 {
51 }); 51 if (panelWindow)
52 panelWindow.postMessage({type: eventName, queryString}, "*");
53 });
54 }
52 } 55 }
53 ); 56 );
54 } 57 }
55 } 58 }
56 ); 59 );
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