Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
helenxiia committed Jan 18, 2021
1 parent 1298834 commit 7000952
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
8 changes: 7 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"name": "wikipedia link race game",
"name": "Racepedia",
"version": "1.0",
"description": "automatically generates a start and end site, user needs to navigate it.",
"permissions": [
Expand All @@ -18,6 +18,12 @@
"default_popup": "popup/popup.html",
"default_icon" : "images/icon.png"
},
"content_scripts": [
{
"matches": ["http://*.nytimes.com/*"],
"js": ["popup/contentScript.js"]
}
],
"icons": {
"16": "images/icon.png",
"32": "images/icon.png",
Expand Down
Empty file added popup/contentScript.js
Empty file.
3 changes: 2 additions & 1 deletion popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

<body>
<h1>Wikipedia Race</h1>

<div class="arrowset">
<h3 style="padding-right: 10px;"> > </h3>
<a href="topic.html" style="text-decoration: none;">
<button id="myButton1">start game</button>
<button id="myFirstButton">start game</button>
</a>
<h3 style="padding-left: 16px;"> < </h3>
</div>
Expand Down
15 changes: 7 additions & 8 deletions popup/popup.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
document.getElementById("myButton").addEventListener("click", displayArticles);

function displayArticles() {
chrome.tabs.getSelected(null, function(tab) { //<-- "tab" has all the information
console.log(tab.url); //returns the url
console.log(tab.title); //returns the title
});
}
document.getElementById("myFirstButton").addEventListener("click", printLog);

function printLog() {
console.log("hello ur mom1")
}



7 changes: 6 additions & 1 deletion popup/topic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
document.getElementById("myButton").addEventListener("click", printLog);

function printLog() {
console.log("hello world");
console.log("hello ur mom")
}

function makeColumn() {
chrome.tabs.executeScript({
file: 'contentScript.js'
});
}

0 comments on commit 7000952

Please sign in to comment.