Skip to content

Instantly share code, notes, and snippets.

@tyage
Created December 17, 2013 13:51
Show Gist options
  • Save tyage/8005203 to your computer and use it in GitHub Desktop.
Save tyage/8005203 to your computer and use it in GitHub Desktop.
this is mod for Secure Shell(Google Chrome Extension).
var xhr = new XMLHttpRequest();
var url = 'https://gist.github.com/tyage/7823731/raw/b1ff47d4444f68fe76b3e91423648bb4d58eb564/yuyulist';
xhr.open('GET', url, true);
xhr.onloadend = function onReady() {
if (xhr.readyState != XMLHttpRequest.DONE || xhr.status != 200)
return;
var images = this.responseText.split("\n");
var screen = document.querySelector("#terminal>iframe").contentDocument.querySelector("x-screen");
screen.style.setProperty('background-size', '100%', '!important');
screen.style.setProperty('background-repeat', 'no-repeat', '!important');
var changeBackground = function() {
var image = images[Math.floor(Math.random() * images.length)];
screen.style.setProperty('background-image', 'url("' + image + '")', '!important');
};
changeBackground();
setInterval(changeBackground, 1000*10);
// deny default settings
hterm.ScrollPort.prototype.setBackgroundImage = function() {};
hterm.ScrollPort.prototype.setBackgroundSize = function() {};
};
xhr.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment