Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when setting dictPath to an https url #94

Open
akukerang opened this issue Apr 24, 2022 · 6 comments
Open

Error when setting dictPath to an https url #94

akukerang opened this issue Apr 24, 2022 · 6 comments

Comments

@akukerang
Copy link

When using it an Chrome content script, setting the Kuromoji analyzer dict path to an https server, would just send a GET request to "https://currentsite.com/https://dhasdjashdkajdha.com/...". I would like it just for it to be "https://dhasdjashdkajdha.com/....".
Using an http URL works fine, but Chrome would return the error "Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '<URL>'. This request has been blocked; the content must be served over HTTPS."
Is there a way that I can set the dictPath to an https url?

import Kuroshiro from "kuroshiro";
// Initialize kuroshiro with an instance of analyzer (You could check the [apidoc](#initanalyzer) for more information):
// For this example, you should npm install and import the kuromoji analyzer first
import KuromojiAnalyzer from "kuroshiro-analyzer-kuromoji"
// Instantiate
const kuroshiro = new Kuroshiro();
// Initialize
// Here uses async/await, you could also use Promise
await kuroshiro.init(new KuromojiAnalyzer({
    dictPath: "https://dhasdjashdkajdha.com/"
}));
// Convert what you want
const result = await kuroshiro.convert("感じ取れたら手を繋ごう、重なるのは人生のライン and レミリア最高!", { to: "hiragana" });
console.log(result);
@chinenvinicius
Copy link

have u solved it? @akukerang

@akukerang
Copy link
Author

@chinenvinicius no

@chinenvinicius
Copy link

chinenvinicius commented Aug 6, 2022

seems like it calls dictpath on the index page but when i go to other pages. this dictfile deosnt load at all. only working on one page.

let kuroshiro = new Kuroshiro();
await kuroshiro.init(new KuromojiAnalyzer());
.
this is the code . do u have the same issue?
スクリーンショット (38)

@akukerang
Copy link
Author

I kind of gave up trying to figure it out and I can't really remember what the error was exactly. Sorry about that.

@jgaynor17
Copy link

seems like it calls dictpath on the index page but when i go to other pages. this dictfile deosnt load at all. only working on one page.

let kuroshiro = new Kuroshiro(); await kuroshiro.init(new KuromojiAnalyzer()); . this is the code . do u have the same issue? スクリーンショット (38)

did you solve this?

@chinenvinicius
Copy link

@jgaynor17 i couldnt solve it. but these have to do with core code. u need to use an old version of kuroshiro which work but it slow to donwload on the client . in my case it takes more than 30 seconds to dowload the whole library if speed is issue i would recommmend to implement it on the server side not client side. this issues is problay have to do on hotw dictionary is being passed on the code., kuroshiro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants