GoatCounter là “nền tảng phân tích trang web nguồn mở có sẵn dưới dạng dịch vụ được lưu trữ hoặc ứng dụng tự lưu trữ. Nó nhằm mục đích cung cấp các phân tích trang web thân thiện với quyền riêng tư, dễ sử dụng và có ý nghĩa như một giải pháp thay thế cho Google Analytics. ” Nó miễn phí cho mục đích sử dụng phi thương mại, nhưng vì tôi sử dụng nó hàng ngày nên tôi đóng góp vài đô la mỗi tháng để giúp người tạo ra nó duy trì nó lâu nhất có thể
Một thứ mà nó không có là một url mà tôi có thể đánh dấu để nhanh chóng chuyển đến số liệu thống kê của ngày hiện tại. Trong JavaScript, bạn có thể sử dụng
[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
8 và các ký tự mẫu để tạo URL này và [hầu hết] các trình duyệt thậm chí còn có cách lưu chức năng JavaScript một lần này làm dấu trangTại sao?
Chế độ xem “ngày” hiển thị số lượt xem trang và liên kết giới thiệu rơi vào ngày hiện tại. GoatCounter có một nút để tải chế độ xem ngày hiện tại, nhưng chức năng của nút này là sử dụng JavaScript để đặt tham số truy vấn url để bao gồm
[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
9 và javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
0 của ngày hiện tạiĐiều này có nghĩa là vào bất kỳ ngày nào, nếu bạn đánh dấu trang, bạn sẽ không lưu "xem ngày hiện tại" mà thay vào đó chỉ đánh dấu các tham số truy vấn hiện tại. Điều tôi thực sự muốn là một nút tự động đưa tôi đến url chế độ xem ngày hiện tại
Làm sao?
Theo những gì tôi có thể nói, việc chèn một đoạn mã JavaScript ngắn vào dấu trang có vẻ như là chức năng được hỗ trợ trong tất cả các trình duyệt chính và đã có từ khá lâu. Tôi đã tìm thấy một bài báo trình bày chi tiết về các dấu trang viết kịch bản, nhưng chúng chỉ cần hai điều — URL cần được mã hóa URI và bắt đầu bằng một chuỗi
javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
1. Mã hóa URI có thể có nhiều sắc thái hơn một chút so với vẻ ngoài của nó, nhưng tôi đã viết một bài đăng khác có nhiều chi tiết hơn về mã hóa chuỗi nói chungJavaScript gốc
[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
8 thường không phải là kiểu dữ liệu thú vị để làm việc, vì vậy mọi người thường tìm đến một thư viện như javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
3 hoặc javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
0. Vì chức năng một dòng này không thể cài đặt các phụ thuộc nên chúng tôi sẽ phải thực hiện nó trong một chặng đường dài[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
Nếu tôi gọi cho
javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
1 vào ngày đăng bài viết này, nó sẽ trả về javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
2. Để đảm bảo mã này được gọi khi nhấp vào biểu tượng dấu trang, hàm cũng được định dạng là javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
3 hoặc Biểu thức hàm được gọi ngay lập tứcCó một triệu công cụ sẽ mã hóa một chuỗi, nhưng tôi thích cái này của Eric Meyer. Sau khi chạy chức năng của tôi thông qua và mở đầu nó bằng nhãn
javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
1, chuỗi cuối cùng sẽ trông như thế nàyjavascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
Xong. Với khả năng viết kịch bản nhanh chóng mọi thứ, bầu trời thực sự là giới hạn. Tôi có thể tạo một dấu trang để chuyển tiếp trang web hiện tại sang buildwith. com, kích hoạt một webhook và tải nó bằng một số dịch vụ khác hoặc viết một phiên bản của tiện ích mở rộng
javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
5Điểm thưởng. Cách tạo kiểu cho biểu tượng
Tôi thấy phiền khi biểu tượng dấu trang được lưu dưới dạng quả địa cầu mặc định của FireFox, vì vậy tôi muốn tạo kiểu cho nó. Các trình duyệt khác có thể có cách để làm những việc tương tự
FireFox điền vào các biểu tượng trong thanh dấu trang bằng biểu tượng yêu thích của url và JavaScript sẽ không có biểu tượng này
FireFox cho phép viết CSS để tùy chỉnh trình duyệt chrome, mặc dù nó hơi phức tạp. David Walsh có một bài viết thực sự hay hướng dẫn cách tìm tệp CSS có liên quan, thiết lập nó để duy trì giữa các lần cập nhật ứng dụng và thay đổi cài đặt để áp dụng các kiểu tùy chỉnh
Bất kỳ văn bản nào được sử dụng trong bộ chọn thuộc tính
javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
6 cần khớp với trường javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
7 của dấu trang. Bạn sẽ phải tìm kiếm xung quanh tệp 16x16 px javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
8 hoặc javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
9 để sử dụng làm [function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
10 cho dấu trang của mình. Tôi đã có thể liên kết đến favicon GoatCounter chuẩn. CSS cuối cùng cần đưa vào [function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
11 trông như thế này[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
1Một số dấu trang khác của tôi có trường
javascript:[function[]%20%7B%0A%20%20function%20formatDate[date]%20%7B%0A%20%20%20%20var%20d%20%3D%20new%20Date[date]%3B%0A%20%20%20%20var%20month%20%3D%20%27%27%20%2B%20[d.getMonth[]%20%2B%201]%3B%0A%20%20%20%20var%20day%20%3D%20%27%27%20%2B%20d.getDate[]%3B%0A%20%20%20%20var%20year%20%3D%20d.getFullYear[]%3B%0A%20%20%20%20if%20[month.length%20%3C%202]%20%7B%20month%20%3D%20%270%27%20%2B%20month%3B%20%7D%0A%20%20%20%20if%20[day.length%20%3C%202]%20%7B%20day%20%3D%20%270%27%20%2B%20day%3B%20%7D%0A%20%20%20%20return%20%5Byear%2C%20month%2C%20day%5D.join[%27-%27]%0A%20%20%7D%0A%20%20var%20today%20%3D%20formatDate[Date.now[]]%0A%20%20return%20window.location.replace[%60https%3A%2F%2Fryanfiller.goatcounter.com%2F%3Fhl-period%3Dday%26period-start%3D%24%7Btoday%7D%26period-end%3D%24%7Btoday%7D%26filter%3D%26as-text%3Doff%26daily%3Doff%60]%0A%7D][]
7 trống và chỉ hiển thị dưới dạng biểu tượng. Tôi đã ẩn dấu trang của [function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
13 để nó khớp với nhau[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
6Nếu bạn muốn tìm hiểu thêm về các thành phần và lớp mà FireFox sử dụng để xây dựng và định kiểu trình duyệt, Mozilla có một bài viết chuyên sâu về cách sử dụng trình kiểm tra web trên trình duyệt bên ngoài cửa sổ khung nhìn. Có toàn bộ một subreddit dành cho “Đẩy các giới hạn của Trình duyệt Firefox thông qua việc sử dụng CSS” có rất nhiều tài nguyên tuyệt vời về các tùy chỉnh phức tạp hơn nhiều
Tôi cũng đã cam kết các kiểu này vào kho lưu trữ
[function go[] {
function formatDate[date] {
var d = new Date[date];
var month = '' + [d.getMonth[] + 1];
var day = '' + d.getDate[];
var year = d.getFullYear[];
if [month.length < 2] { month = '0' + month; }
if [day.length < 2] { day = '0' + day; }
return [year, month, day].join['-']
}
var today = formatDate[Date.now[]]
return window.location.replace[`//ryanfiller.goatcounter.com/?hl-period=day.-start=${today}.-end=${today}&filter=&as-text=off&daily=off`]
}][]
14 của mình để tôi có thể di chuyển chúng giữa các thiết bị thuận tiện hơn