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

Side by Side Diff: background.js

Issue 29564735: Issue 5587 - Use options module (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Include check for mobile-options.html Created Oct. 5, 2017, 12:08 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
« no previous file with comments | « no previous file | ext/background.js » ('j') | 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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 updateFromURL(modules.info); 390 updateFromURL(modules.info);
391 391
392 modules.subscriptionInit = { 392 modules.subscriptionInit = {
393 reinitialized: params.filterlistsReinitialized 393 reinitialized: params.filterlistsReinitialized
394 }; 394 };
395 395
396 modules.messaging = { 396 modules.messaging = {
397 port: new EventEmitter() 397 port: new EventEmitter()
398 }; 398 };
399 399
400 modules.options = {
401 showOptions(callback)
402 {
403 if (!/\/(mobile-)?options\.html\b/.test(top.location.href))
404 window.open("options.html", "_blank");
405
406 if (callback)
407 callback();
408 }
409 };
410
400 window.addEventListener("message", (event) => 411 window.addEventListener("message", (event) =>
401 { 412 {
402 if (event.data.type != "message") 413 if (event.data.type != "message")
403 return; 414 return;
404 let message = event.data.payload; 415 let message = event.data.payload;
405 let {messageId} = event.data; 416 let {messageId} = event.data;
406 let sender = { 417 let sender = {
407 page: new ext.Page(event.source) 418 page: new ext.Page(event.source)
408 }; 419 };
409 420
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 }, 601 },
591 filter: { 602 filter: {
592 text: "||example.com/some-annoying-popup$popup", 603 text: "||example.com/some-annoying-popup$popup",
593 whitelisted: false, 604 whitelisted: false,
594 userDefined: true, 605 userDefined: true,
595 subscription: null 606 subscription: null
596 } 607 }
597 }); 608 });
598 }); 609 });
599 }()); 610 }());
OLDNEW
« no previous file with comments | « no previous file | ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld