javascript 的评价
javascript 作者: chee
991730 的评价
It's a nice addon. If only it worked on every page... I wrote a small utility script for Youtube. The script runs when it's a freshly opened Youtube tab, but not if a new video was loaded via autoplay. I'd really like to know why. (note that I also have this issue with other JS scripting addons).
开发者回应
发布于 5 年前:) thanks for the review.
it doesn't work on autoplay videos because it's just a script tag injected into the page. an autoplaying video doesn't load a new page, youtube's javascript does a request and replaces the video element in the dom (and a lot of other elements ^_^).
i don't know how much JS you know, but you might be able to implement something as a callback to a mutation observer: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
:)
it doesn't work on autoplay videos because it's just a script tag injected into the page. an autoplaying video doesn't load a new page, youtube's javascript does a request and replaces the video element in the dom (and a lot of other elements ^_^).
i don't know how much JS you know, but you might be able to implement something as a callback to a mutation observer: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
:)
60 条评价
- Very good. But I'd like to know if it's possible to create a script that runs on all pages. I'd like to implement a dark mode that activates when a button is pressed.
Also, I'd like to know if it's possible to specify the DOM tag when adding the script. I was using a polyfill, but since it runs last, I had to reload the other scripts for them to run without errors. - 评分 4 / 5来自 Firefox 用户 16703548, 1 年前
- 评分 5 / 5来自 sexy_pikachu, 1 年前Very convenient tool. I use this to trigger auto-scrolling.
```js
setInterval(() => window.scrollBy({
top: 100,
behavior: "smooth",
}), 100)
``` - 评分 5 / 5来自 Firefox 用户 17765782, 2 年前
- 评分 5 / 5来自 Lucy the Pirate, 2 年前Thank you for makin' this plugin! I was able to use it to write a script to block players on a comment board for a website that didn't have a block function built in!
- 评分 3 / 5来自 RickinMaine, 2 年前
- 评分 1 / 5来自 Firefox 用户 18047774, 3 年前
- 评分 5 / 5来自 Firefox 用户 17716521, 3 年前Very good. It works well. The only little bug I noticed is that the extension doesn't work with local files.
- 评分 5 / 5来自 Firefox 用户 14536207, 3 年前