This repository was archived by the owner on Jun 24, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +51
-49
lines changed Expand file tree Collapse file tree 6 files changed +51
-49
lines changed Original file line number Diff line number Diff line change
1
+ .DS_store
Original file line number Diff line number Diff line change 21
21
return resolve ( element ) ;
22
22
} ) ;
23
23
} , delay ) ;
24
- } else {
25
- alert ( 'twitter-cutomized-muting extension error: Failed to select element: ' + id ) ;
26
24
}
27
25
} ) ;
28
26
} ;
133
131
RetryableGetElementById ( 'stream-items-id' , 5 , 500 ) . then ( function ( streamItems ) {
134
132
PreObserver . observe ( streamItems ) ;
135
133
MuteObserver . observe ( streamItems ) ;
136
- RefreshObserver . observe ( document ) ;
137
134
} ) ;
135
+ RefreshObserver . observe ( document ) ;
138
136
139
137
/* Insert mute button */
140
138
document . styleSheets [ 0 ] . insertRule ( '.Icon--volume-off:before { content: "\\f056"}' , 0 ) ;
141
- ( function ( topbar ) {
139
+ RetryableGetElementById ( 'global-actions' , 0 , 0 ) . then ( function ( topbar ) {
142
140
var icon = document . createElement ( 'span' ) ;
143
141
icon . className = 'Icon Icon--volume-off Icon--large' ;
144
142
var text = document . createElement ( 'span' ) ;
177
175
li . id = 'mute-nav-id' ;
178
176
li . appendChild ( a ) ;
179
177
topbar . appendChild ( li ) ;
180
- } ) ( document . getElementById ( 'global-actions' ) ) ;
178
+ } ) ;
181
179
182
180
} ;
183
181
iframe . setAttribute ( 'src' , chrome . extension . getURL ( 'sandbox.html' ) ) ;
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " twitter-customized-muting " ,
3
- "version" : " 0.3 .0" ,
2
+ "name" : " Twitter Customized Muting " ,
3
+ "version" : " 1.0 .0" ,
4
4
"manifest_version" : 2 ,
5
5
"description" : " カスタマイズ可能なミュート機能をTwitter公式Web版に提供" ,
6
6
"content_scripts" : [{
7
- "js" : [" content.js" ],
7
+ "js" : [" contents/ content.js" ],
8
8
"matches" : [" https://twitter.com/*" ],
9
9
"run_at" : " document_end"
10
10
}],
11
11
"sandbox" : {
12
- "pages" : [" sandbox.html" ]
12
+ "pages" : [" sandboxes/ sandbox.html" ]
13
13
},
14
- "web_accessible_resources" : [" sandbox.html" ]
14
+ "icons" : {
15
+ "128" : " icons/icon128.png"
16
+ },
17
+ "web_accessible_resources" : [" sandboxes/sandbox.html" ]
15
18
}
Original file line number Diff line number Diff line change 1
- <!DOCTYPE html>
2
- < html >
3
- < head >
4
- < script src ="sandbox.js "> </ script >
5
- </ head >
6
- < body >
7
- </ body >
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < script src ="sandbox.js "> </ script >
5
+ </ head >
6
+ < body >
7
+ </ body >
8
8
</ html >
Original file line number Diff line number Diff line change 1
- ( function ( ) {
2
-
3
- var callback = function ( ) { return false ; } ;
4
-
5
- window . addEventListener ( 'message' , function ( e ) {
6
- switch ( e . data . actionType ) {
7
- case 'set-callback' :
8
- callback = new Function (
9
- 'user_id_str' ,
10
- 'screen_name' ,
11
- 'name' ,
12
- 'text' ,
13
- 'is_in_notification_area' ,
14
- 'is_promotion' ,
15
- 'is_retweet' ,
16
- 'retweeter_user_id_str' ,
17
- 'retweeter_screen_name' ,
18
- 'retweeter_name' ,
19
- e . data . code
20
- ) ;
21
- break ;
22
- case 'go-callback' :
23
- if ( callback . apply ( { } , e . data . params ) ) {
24
- e . source . postMessage ( {
25
- actionType : 'tcm-remove-tweet' ,
26
- itemId : e . data . itemId ,
27
- } , e . origin ) ;
28
- }
29
- break ;
30
- }
31
- } ) ;
32
-
1
+ ( function ( ) {
2
+
3
+ var callback = function ( ) { return false ; } ;
4
+
5
+ window . addEventListener ( 'message' , function ( e ) {
6
+ switch ( e . data . actionType ) {
7
+ case 'set-callback' :
8
+ callback = new Function (
9
+ 'user_id_str' ,
10
+ 'screen_name' ,
11
+ 'name' ,
12
+ 'text' ,
13
+ 'is_in_notification_area' ,
14
+ 'is_promotion' ,
15
+ 'is_retweet' ,
16
+ 'retweeter_user_id_str' ,
17
+ 'retweeter_screen_name' ,
18
+ 'retweeter_name' ,
19
+ e . data . code
20
+ ) ;
21
+ break ;
22
+ case 'go-callback' :
23
+ if ( callback . apply ( { } , e . data . params ) ) {
24
+ e . source . postMessage ( {
25
+ actionType : 'tcm-remove-tweet' ,
26
+ itemId : e . data . itemId ,
27
+ } , e . origin ) ;
28
+ }
29
+ break ;
30
+ }
31
+ } ) ;
32
+
33
33
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments