-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpanel.js
37 lines (29 loc) · 992 Bytes
/
panel.js
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
chrome.tabs.getCurrent(function (atab) {
chrome.runtime.sendMessage({remove_mobile_tab_id: atab.id}, function(response){
if (response["exists"] == true) {
console.log("reloading...");
location.reload();
};
});
});
$(document).ready(function() {
console.log("Sending request for frame src");
chrome.runtime.sendMessage({get_frame_src: true}, function(response) {
console.log("Get response for get_frame_src, src=" + response.frame_src);
update_source_url(response.frame_src);
});
window.onresize = resize;
function resize()
{
console.log("resize event detected!");
$("#player-frame").css("width", $(window).width());
$("#player-frame").css("height", $(window).height());
console.log("Size of #player-frame set to " + $(window).width() + "x" + $(window).height());
}
window.onresize();
});
var update_source_url = function(url) {
console.log("Changing src to " + url);
$("#player-frame").attr("src", url);
console.log($("#player-frame").html());
}