[UserScript] Advanced Context Sentence

I have been using the same trick in a Bunpro script and someone told me that it can be fixed by changing “no-referrer” to “same-origin”

1 Like

why don’t I found this earlier? this is really helpful!

I don’t really know much about this stuff, but after reading about these options, I’m confused why this would change anything. If I’m understanding this correctly, both the no-referrer and the same-origin setting will result in no Referer header being sent for cross-origin requests. And I would have assumed that a request to Google Translate is cross-origin?

1 Like

Honestly, I have no clue. I don’t have a BP membership anymore so I couldn’t test the fix myself, but the person who reported the fix told me it did indeed work. I don’t know why it does

1 Like

Thank you Sinyaven for the fix. Tried to do the new content update lessons and found a few of my scripts weren’t working!

1 Like

Thanks so much! Any chance you could fork this on greasyfork?

1 Like

I have uploaded the fix to GreasyFork: Advanced Context Sentence.

I think I would prefer it if @abdullahalt or one of the @Mods edits the installation link in the first post of this thread to something like this:

Installation

Hope you enjoy it! [outdated version]
New version maintained by @Sinyaven

If there are multiple [Userscript] Advanced Context Sentence threads, people searching for this script have a harder time finding out which version they should install. And if @abdullahalt returns and wants to continue supporting this script, they just have to change back the installation link in their post.

5 Likes

Thank you!

There are a couple of examples where the pinned wiki was updated with the new thread next to the old one so anyone reading down the list will clearly see it’s a version 2. You can edit it. But either way - altering the original post is also good.

Most importantly thank you for uploading it. Much easier this way.

Seems that this script is incompatible with the Anime Sentences Userscript. Works like a charm without it though! Both are great for enhancing context… which to choose… :thinking:

I have not encountered any problems with both scripts installed. Can you give an example where a problem occurs? Does it happen during lessons, reviews, on the item page, or everywhere?

1 Like

For me, it seems to only interfere within the Reviews.


Here’s what it looks like.

Also when doing lessons it doesn’t seem to be active at all, even with Anime Sentences Disabled.:grimacing:

I think this problem should already be fixed in this fork of the Advanced Context Sentence script:

Will update then. Thanks for your assistance! I’m not very savvy with this kind of stuff.

The mods don’t seem to have edited the original post on this. I still think it would be beneficial to start a new thread for your version (call it v2), link back to this old thread, and edit the pinned Wiki with the new thread link. As long as the Wiki is updated people won’t have trouble finding the right one to install.

Hello @Sinyaven - I’m not sure if this is new behaviour but in Safari 15.1 if I select the web browser audio option then I get a readout of each individual character, rather than the words. The google translate version works, thankfully.

I’m still a bit reluctant to create a new thread for my modification – I have not even read through the whole code, so it feels weird to create my own thread for it. For now, I have changed the link in the pinned wiki to point to my post with the fork.

It still works as intended for me (Edge and Firefox on Windows), so I don’t know what the problem could be. If you want, you can go to this Speech Synthesis Reader and check if you have a Japanese voice in the dropdown, and also test if the problem still occurs if you listen to the context sentence through this page.

1 Like

I installed the Kyoko japanese TTS voice for my mac and now it seems to work - thanks!

1 Like

I have reconsidered my stance regarding this and created a new thread for my fork:

2 Likes

Thank-you! Wonderful to have audio button instead of highlighting and listening to defective apple voice.