forked from Kenshin/simpread
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.js
More file actions
46 lines (43 loc) · 1.17 KB
/
message.js
File metadata and controls
46 lines (43 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
console.log( "=== simpread message load ===" )
const action = {
focus_mode : "focus",
read_mode : "read",
shortcuts : "shortcuts",
browser_action : "browser_action",
browser_click : "browser_click",
tab_selected : "tab_selected",
new_tab : "new_tab",
close_tab : "close_tab",
menu : "menu",
updated : "updated",
save_verify : "save_verify",
storage : "storage", // only firefox
// about export and auth
auth : "auth",
auth_success : "auth_success",
export : "export",
redirect_uri : "redirect_uri",
// dyslexia
speak : "speak",
speak_stop : "speak_stop",
// track
track : "track",
// site
update_site : "update_site",
pending_site : "pending_site",
save_site : "save_site",
temp_site : "temp_site",
};
/**
* Add message object
*
* @param {string} @see action
* @param {object} { code,url }
*/
function add( type, value = {} ) {
return { type, value };
}
export {
add as Add,
action as MESSAGE_ACTION
}