Skip to content

Instantly share code, notes, and snippets.

@moyashi
Last active February 7, 2020 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moyashi/4c009686680ca053bed9ce86dd50f67c to your computer and use it in GitHub Desktop.
Save moyashi/4c009686680ca053bed9ce86dd50f67c to your computer and use it in GitHub Desktop.
OptoPrintでページ表示後に「Connect」ボタンを自動的に押すUserScript
// ==UserScript==
// @name PrinterConnect
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://192.168.1.33/
// @match http://192.168.1.32/
// @grant none
// ==/UserScript==
(function() {
'use strict';
var connect = function(){
if ($("#printer_connect").text() == "Connect") {
$("#printer_connect").click();
}
}
setTimeout(connect, 5000);
})();
@moyashi
Copy link
Author

moyashi commented Feb 7, 2020

Tampermonkeyで動作確認
https://www.tampermonkey.net/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment