Index: messageResponder.js |
=================================================================== |
--- a/messageResponder.js |
+++ b/messageResponder.js |
@@ -16,39 +16,40 @@ |
*/ |
/* globals require */ |
"use strict"; |
(function(global) |
{ |
- const {port} = require("messaging"); |
- const {Prefs} = require("prefs"); |
- const {Utils} = require("utils"); |
- const {FilterStorage} = require("filterStorage"); |
- const {FilterNotifier} = require("filterNotifier"); |
- const {defaultMatcher} = require("matcher"); |
- const {Notification: NotificationStorage} = require("notification"); |
+ const {port} = require("../lib/messaging"); |
+ const {Prefs} = require("../lib/prefs"); |
+ const {Utils} = require("../lib/utils"); |
+ const {FilterStorage} = require("../adblockpluscore/lib/filterStorage"); |
Thomas Greiner
2018/07/26 10:07:59
It'd be great if we could avoid hardcoding the loc
|
+ const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier"); |
+ const {defaultMatcher} = require("../adblockpluscore/lib/matcher"); |
+ const {Notification: |
+ NotificationStorage} = require("../adblockpluscore/lib/notification"); |
const {getActiveNotification, shouldDisplay, |
- notificationClicked} = require("notificationHelper"); |
+ notificationClicked} = require("../lib/notificationHelper"); |
const { |
Filter, ActiveFilter, BlockingFilter, RegExpFilter |
- } = require("filterClasses"); |
- const {Synchronizer} = require("synchronizer"); |
+ } = require("../adblockpluscore/lib/filterClasses"); |
+ const {Synchronizer} = require("../adblockpluscore/lib/synchronizer"); |
const info = require("info"); |
const { |
Subscription, |
DownloadableSubscription, |
SpecialSubscription |
- } = require("subscriptionClasses"); |
+ } = require("../adblockpluscore/lib/subscriptionClasses"); |
- const {showOptions} = require("options"); |
+ const {showOptions} = require("../lib/options"); |
port.on("types.get", (message, sender) => |
{ |
let filterTypes = Array.from(require("requestBlocker").filterTypes); |
filterTypes.push(...filterTypes.splice(filterTypes.indexOf("OTHER"), 1)); |
return filterTypes; |
}); |
@@ -151,17 +152,17 @@ |
!subscription.lastDownload) |
Synchronizer.execute(subscription); |
} |
port.on("app.get", (message, sender) => |
{ |
if (message.what == "issues") |
{ |
- let subscriptionInit = require("subscriptionInit"); |
+ let subscriptionInit = require("../lib/subscriptionInit"); |
return { |
dataCorrupted: subscriptionInit.isDataCorrupted(), |
filterlistsReinitialized: subscriptionInit.isReinitialized() |
}; |
} |
if (message.what == "doclink") |
{ |
@@ -214,17 +215,17 @@ |
sendMessage("app", message.action, ...message.args); |
}); |
} |
}); |
port.on("filters.add", (message, sender) => |
{ |
- let result = require("filterValidation").parseFilter(message.text); |
+ let result = require("../lib/filterValidation").parseFilter(message.text); |
let errors = []; |
if (result.error) |
errors.push(result.error.toString()); |
else if (result.filter) |
FilterStorage.addFilter(result.filter); |
return errors; |
}); |
@@ -244,17 +245,17 @@ |
if (!subscription) |
return []; |
return subscription.filters.map(convertFilter); |
}); |
port.on("filters.importRaw", (message, sender) => |
{ |
- let result = require("filterValidation").parseFilters(message.text); |
+ let result = require("../lib/filterValidation").parseFilters(message.text); |
let errors = []; |
for (let error of result.errors) |
{ |
if (error.type != "unexpected-filter-list-header") |
errors.push(error.toString()); |
} |
if (errors.length > 0) |