Skip to content

Chrome

Main browswer I use.#

browswer tricks#

(see also JavaScript page) copy from console

from https://stackoverflow.com/a/25140576/10942184

extensions:#

User JavaScript and CSS#

FOR: https://www.youtube.com/

 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
37
38
/// To speed up > 2 times
var v = document.getElementsByTagName("video")[0]
document.addEventListener('keypress', function (event) {
  if (event.key == '>') {
    if (v.playbackRate > 2) { v.playbackRate++; }
    showToast(v.playbackRate + 'x', '', 1500)
  }
  if (event.key == '<') {
    if (v.playbackRate < 0.25) { v.playbackRate /= 2; }
    showToast(v.playbackRate + 'x', '', 1500)
  }
});

function showToast(text1, text2, showMs = 1500) {
  var div0 = document.createElement("div");
  div0.setAttribute("id", "toast");
  var div1 = document.createElement("div");
  var textnode1 = document.createTextNode(text1);
  div1.appendChild(textnode1);
  div1.setAttribute("id", "img");

  var div2 = document.createElement("div");
  var textnode2 = document.createTextNode(`by Pablion`);
  div1.setAttribute("id", "desc");

  div0.appendChild(div1);
  div0.appendChild(div2);

  var pagebody = document.getElementsByTagName("BODY")[0];
  pagebody.insertBefore(div0, pagebody.firstChild); // add to first place

  div0.className = "show";
  setTimeout(function () {
    div0.className = div0.className.replace("show", "");
    pagebody.removeChild(div0);
  }, showMs);

};
 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#toast {
    visibility: hidden;
    max-width: 50px;
    height: 50px;
    /*margin-left: -125px;*/
    margin: auto;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;

    position: fixed;
    z-index: 1;
    left: 0;right:0;
    bottom: 30px;
    font-size: 17px;
    white-space: nowrap;
}
#toast #img{
    width: 50px;
    height: 50px;

    float: left;

    padding-top: 16px;
    padding-bottom: 16px;

    box-sizing: border-box;


    background-color: #111;
    color: #fff;
}
#toast #desc{


    color: #fff;

    padding: 16px;

    overflow: hidden;
    white-space: nowrap;
}

#toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 2s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 4s, fadeout 0.5s 4.5s;
}

@-webkit-keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes expand {
    from {min-width: 50px}
    to {min-width: 350px}
}

@keyframes expand {
    from {min-width: 50px}
    to {min-width: 350px}
}
@-webkit-keyframes stay {
    from {min-width: 350px}
    to {min-width: 350px}
}

@keyframes stay {
    from {min-width: 350px}
    to {min-width: 350px}
}
@-webkit-keyframes shrink {
    from {min-width: 350px;}
    to {min-width: 50px;}
}

@keyframes shrink {
    from {min-width: 350px;}
    to {min-width: 50px;}
}

@-webkit-keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 60px; opacity: 0;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 60px; opacity: 0;}
}
  • 这个是浏览器隔离的,每个浏览器都会把 localStorage 存储在自己的 UserData 中,如 chrome 一般是 C:\Users\你的计算机名\AppData\Local\Google\Chrome\User Data\Default\Local Storage

old#

我的 vue+chrome 不支持箭头函数

1
2
3
4
isUserNameLegal: () => {
  console.log(this.userName)
  return this.userName
} ,

无效

1
2
3
4
isUserNameLegal: function() {
  console.log(this.userName)
  return this.userName
} ,

却有效

2019-5-27 19:44:57 Chrome 目前不支持 ES6 的 import 语法。