File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ ASSEMBLY =./quicktip
2
+
3
+ .DEFAULT_GOAL : $(ASSEMBLY )
4
+
5
+ $(ASSEMBLY ) :
6
+ $(GOPATH ) /bin/gopherjs build app.go -o ${ASSEMBLY} /app.js
7
+ cp manifest.json ${ASSEMBLY}
8
+ cp info.html ${ASSEMBLY}
9
+ clean :
10
+ if [ -d ${ASSEMBLY} ] ; then rm -rf ${ASSEMBLY} ; fi
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "github.com/dominikh/go-js-dom"
5
+ "github.com/fabioberger/chrome"
6
+ "strconv"
7
+ )
8
+
9
+ func main () {
10
+ c := chrome .NewChrome ()
11
+
12
+ tabDetails := chrome.Object {
13
+ "active" : false ,
14
+ }
15
+
16
+ c .Tabs .Create (tabDetails , func (tab chrome.Tab ) {
17
+ notification := "Tab with id: " + strconv .Itoa (tab .Id ) + " created!"
18
+ dom .GetWindow ().Document ().GetElementByID ("notification" ).SetInnerHTML (notification )
19
+ })
20
+
21
+ }
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < head >
3
+ < style >
4
+ # notification {
5
+ width : 300px ;
6
+ }
7
+ </ style >
8
+ </ head >
9
+ < body >
10
+ < h1 id ="notification "> </ h1 >
11
+ < script src ="app.js "> </ script >
12
+ </ body >
13
+ </ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "manifest_version" : 2 ,
3
+
4
+ "name" : " QuickTip Chrome extension" ,
5
+ "description" : " Chrome extension that is used to translate particular words/phrases on site via TranslateAPI" ,
6
+ "version" : " 1.0" ,
7
+
8
+ "browser_action" : {
9
+ "default_popup" : " info.html"
10
+ },
11
+ "permissions" : [
12
+ " tabs"
13
+ ]
14
+ }
You can’t perform that action at this time.
0 commit comments