tig-spy lix compatibility
This commit is contained in:
@@ -6,4 +6,8 @@ import haxe.Constraints;
|
||||
import tig_spy.Message;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class Background {}
|
||||
class Background {
|
||||
static function main() {
|
||||
_main();
|
||||
}
|
||||
}
|
||||
@@ -8,15 +8,16 @@
|
||||
(API.browser.tabs.sendMessage id (object type "nextPage" data [(pages.shift)]))
|
||||
(API.browser.tabs.sendMessage id (object type "authorList" data collectedAuthors)))))
|
||||
|
||||
(API.browser.runtime.onMessage.addListener ->[:Message message sender sendResponse]
|
||||
(let [:Function sendResponse sendResponse]
|
||||
(case message
|
||||
((object type "authors" data authors)
|
||||
(set collectedAuthors (collectedAuthors.concat authors))
|
||||
(sendNextPage sendResponse))
|
||||
((object type "pages" data pageUrls)
|
||||
(set collectedAuthors [])
|
||||
(set pages pageUrls)
|
||||
(sendResponse ""))
|
||||
(never otherwise))
|
||||
true))
|
||||
(function _main []
|
||||
(API.browser.runtime.onMessage.addListener ->[:Message message sender sendResponse]
|
||||
(let [:Function sendResponse sendResponse]
|
||||
(case message
|
||||
((object type "authors" data authors)
|
||||
(set collectedAuthors (collectedAuthors.concat authors))
|
||||
(sendNextPage sendResponse))
|
||||
((object type "pages" data pageUrls)
|
||||
(set collectedAuthors [])
|
||||
(set pages pageUrls)
|
||||
(sendResponse ""))
|
||||
(never otherwise))
|
||||
true)))
|
||||
|
||||
Reference in New Issue
Block a user