0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ローカル環境なら枠を表示するブックマークレット

Posted at

テストとローカル2つ開いていると混乱する残念な人なので書きました。
ポイントはpointer-events: none;

コード

var url = location.href;
if (url.indexOf("localhost") > 0 || url.indexOf("127.0.0.1") > 0) {
	var div = document.createElement("div");
	div.style.cssText = "position:absolute; top:0; left:0; width:100%; height:100%; outline:solid 3px #2962FF; outline-offset:-10px; pointer-events: none;";
	document.body.appendChild(div);
}

ブックマークレット登録用

javascript:var url = location.href;if (url.indexOf("localhost") > 0 || url.indexOf("127.0.0.1") > 0) {	var div = document.createElement("div");	div.style.cssText = "position:absolute; top:0; left:0; width:100%; height:100%; outline:solid 3px #2962FF; outline-offset:-10px; pointer-events: none;";	document.body.appendChild(div);}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?