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

Side by Side Diff: ext/devtools.js

Issue 5646124035604480: Issue 154 - Added UI for devtools panel on Chrome (Closed)
Patch Set: Created Jan. 7, 2015, 1:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 ext.devtools = {
19 connect: function()
20 {
21 return {
22 postMessage: function() {},
23
24 onMessage: {
25 addListener: function(listener)
Wladimir Palant 2015/01/10 08:33:29 Quite frankly, I don't like the idea of having a d
Sebastian Noack 2015/01/10 08:53:45 Yes, it will be fairly complicated. Ports are very
Thomas Greiner 2015/01/12 10:37:54 Right, the existing abstraction layer would probab
Wladimir Palant 2015/01/13 07:28:04 I see, that's making things too complicated indeed
Sebastian Noack 2015/02/04 14:17:29 As discussed some weeks ago, we can actually use r
26 {
27 // blocked request
28 listener({
29 type: "add-record",
30 request: {
31 url: "http://adserver.example.com/ad_banner.png",
32 type: "IMAGE",
33 docDomain: "example.com"
34 },
35 filter: {
36 text: "/ad_banner*$domain=example.com",
37 whitelisted: false,
38 userDefined: false,
39 subscription: "EasyList"
40 }
41 });
42
43 // whiletisted request
44 listener({
45 type: "add-record",
46 request: {
47 url: "http://example.com/looks_like_an_ad_but_isnt_one.html",
48 type: "SUBDOCUMENT",
49 docDomain: "example.com"
50 },
51 filter: {
52 text: "@@||example.com/looks_like_an_ad_but_isnt_one.html",
53 whitelisted: true,
54 userDefined: false,
55 subscription: "EasyList"
56 }
57 });
58
59 // request with long URL and no filter matches
60 listener({
61 type: "add-record",
62 request: {
63 url: "https://this.url.has.a.long.domain/and_a_long_path_maybe_not _long_enough_so_i_keep_typing?there=are&a=couple&of=parameters&as=well&and=even& some=more",
64 type: "XMLHTTPREQUEST",
65 docDomain: "example.com"
66 },
67 filter: null
68 });
69
70 // matching element hiding filter
71 listener({
72 type: "add-record",
73 request: {
74 type: "ELEMHIDE",
75 docDomain: "example.com"
76 },
77 filter: {
78 text: "example.com##.ad_banner",
79 whitelisted: false,
80 userDefined: false,
81 subscription: "EasyList"
82 }
83 });
84
85 // user-defined filter
86 listener({
87 type: "add-record",
88 request: {
89 url: "http://example.com/some-annoying-popup",
90 type: "POPUP",
91 docDomain: "example.com"
92 },
93 filter: {
94 text: "||example.com/some-annoying-popup$popup",
95 whitelisted: false,
96 userDefined: true,
97 subscription: null
98 }
99 });
Wladimir Palant 2015/01/10 08:33:29 I'd rather have proper message exchange simulated,
Sebastian Noack 2015/01/10 08:53:45 This would makes things significantly more complex
Thomas Greiner 2015/01/12 10:37:54 More complex because we're using two different met
Sebastian Noack 2015/01/12 11:55:07 What Wladimir is suggesting is to inject an iframe
Wladimir Palant 2015/01/13 07:28:04 Yes, this is just us testing that thing properly a
Sebastian Noack 2015/02/04 14:17:29 Yep, done, see above.
100
101 }
102 }
103 };
104 },
105
106 panels: {
107 openResource: function() {}
108 },
109
110 inspectedWindow: {
111 reload: function() {}
112 }
113 }
114
OLDNEW

Powered by Google App Engine
This is Rietveld