2
5
Fork
You've already forked userscripts
2

YT2Invidio not automatically rewriting #6

Open
opened 2021年05月31日 09:05:33 +02:00 by dngray · 7 comments

Hi

I tried this with Violent Monkey which used to be recommended by the Arkenfox project.

I have found that YT2Invidio doesn't automatically re-write. I have to click on "Rewrite now" to make this work.

Is there something I am missing?

Hi I tried this with [Violent Monkey](https://addons.mozilla.org/firefox/addon/violentmonkey/) which [used to be recommended](https://github.com/arkenfox/user.js/issues/796#issuecomment-769315545) by the [Arkenfox project](https://github.com/arkenfox/user.js/wiki/4.1-Extensions). I have found that YT2Invidio doesn't automatically re-write. I have to click on "Rewrite now" to make this work. Is there something I am missing?
Owner
Copy link

You didn't state what site/page you were on, and how content is loaded there. What you describe is normal for pages loading their content "dynamically" via JavaScript (i.e. you get an ampty page if you turn JS off). "Rewrite now" then acts on the loaded content – which was not yet there when the script ran initially.

You didn't state what site/page you were on, and how content is loaded there. What you describe is normal for pages loading their content "dynamically" via JavaScript (i.e. you get an ampty page if you turn JS off). "Rewrite now" then acts on the loaded content – which was not yet there when the script ran initially.
Contributor
Copy link

@dngray This is why I decided to rewrite the script, see https://codeberg.org/ltGuillaume/userscripts

@dngray This is why I decided to rewrite the script, see https://codeberg.org/ltGuillaume/userscripts
Author
Copy link

You didn't state what site/page you were on, and how content is loaded there.

Any page, mostly looking at reddit/teddit results in search engine results.

What you describe is normal for pages loading their content "dynamically" via JavaScript (i.e. you get an ampty page if you turn JS off).

Ah, so I do have JavaScript disabled, ie hard mode.

"Rewrite now" then acts on the loaded content – which was not yet there when the script ran initially.

I guess this is normal behaviour then.

@dngray This is why I decided to rewrite the script, see https://codeberg.org/ltGuillaume/userscripts

I'll take a look at that, I very much like the feature set Izzy ended up doing for this. I wonder if an actual extension wouldn't make this easier rather than a user-script.

> You didn't state what site/page you were on, and how content is loaded there. Any page, mostly looking at reddit/teddit results in search engine results. > What you describe is normal for pages loading their content "dynamically" via JavaScript (i.e. you get an ampty page if you turn JS off). Ah, so I do have JavaScript disabled, ie [hard mode](https://github.com/gorhill/uBlock/wiki/Blocking-mode#hard-mode-details-). > "Rewrite now" then acts on the loaded content – which was not yet there when the script ran initially. I guess this is normal behaviour then. > @dngray This is why I decided to rewrite the script, see https://codeberg.org/ltGuillaume/userscripts I'll take a look at that, I very much like the feature set Izzy ended up doing for this. I wonder if an actual extension wouldn't make this easier rather than a user-script.
Owner
Copy link

I'm quite happy with the "rewrite on demand" (and assigned a hotkey to it). I'm also glad @ltGuillaume created a fork for those who want it "the other way". Both approaches have their pros and cons 😉

I'm quite happy with the "rewrite on demand" (and assigned a hotkey to it). I'm also glad @ltGuillaume created a fork for those who want it "the other way". Both approaches have their pros and cons 😉
Author
Copy link

I'm quite happy with the "rewrite on demand" (and assigned a hotkey to it). I'm also glad @ltGuillaume created a fork for those who want it "the other way". Both approaches have their pros and cons 😉

A hotkey is not a bad idea I guess. Maybe the readme should say something about that.

> I'm quite happy with the "rewrite on demand" (and assigned a hotkey to it). I'm also glad @ltGuillaume created a fork for those who want it "the other way". Both approaches have their pros and cons 😉 A hotkey is not a bad idea I guess. Maybe the readme should say something about that.
Contributor
Copy link

@dngray teddit has these features built-in. Just set the preferences (and allow cookies for teddit to save them).

@dngray teddit has these features built-in. Just set the preferences (and allow cookies for teddit to save them).
Owner
Copy link

A hotkey is not a bad idea I guess. Maybe the readme should say something about that.

Good point. It's Alt-Y – it seems I forgot to push those changes 😱 Done now. Hotkey mentioned in the "history" part of the Readme.

At the very end of the script:

// register keyboard shortcur Alt+Y to trigger rewrite
document.onkeyup=function(e) {
 var e = e || window.event; // for IE to cover IEs window event-object
 if(e.altKey && e.which == 89) {
 doRewrite();
 return false;
 }
}
> A hotkey is not a bad idea I guess. Maybe the readme should say something about that. Good point. It's Alt-Y – it seems I forgot to push those changes :scream: Done now. Hotkey mentioned in the "history" part of the Readme. At the very end of the script: ```javascript // register keyboard shortcur Alt+Y to trigger rewrite document.onkeyup=function(e) { var e = e || window.event; // for IE to cover IEs window event-object if(e.altKey && e.which == 89) { doRewrite(); return false; } } ```
Sign in to join this conversation.
No Branch/Tag specified
master
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
izzy/userscripts#6
Reference in a new issue
izzy/userscripts
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?