I want to make a Chrome Extension that opens every second a list of URL's. I don't have much experience with making Chrome Extensions/Apps. I already have the biggest part of the code but something doesn't work well. I tried many things that i find on the internet. I tried to use an Chrome App instead of a Chrome Extension but that will show some errors. If i start the code it doesn't show errors in the console but nothing happenend. I hope you will find a solution!
The code.
manifest.js
{
"name": "PageViewer",
"description": "Page Viewer extensions.",
"browser_action": {
"default_icon": {
"38": "logo-16.png"
},
"default_title": "Ready for start!",
"default_popup": "window.html"
},
"icons": {
"128": "logo-128.png",
"16": "logo-16.png"
},
"permissions": [
"tabs"
],
"manifest_version": 2,
"version": "0.1"
}
window.html
<!DOCTYPE html>
<html>
<head>
<script src="background.js"></script>
</head>
<body>
<div><input type="button" value="Start" class="start"></div>
</body>
</html>
background.js
chrome.app.runtime.sendRequest.addListener(function() {
var param = 0;
var reload = {
page: function() {
chrome.tabs.getCurrent(function (tab) {
param++;
chrome.tabs.update(tab.id, {url: "http://testsite.com/id/" + param});
});
}
}
document.getElementsByClassName("start").onclick = function() {
setInterval(reload.page(), 11000);
}
});