Git Product home page Git Product logo

overleaf-image-helper's People

Contributors

cmprmsd avatar colinroitt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

overleaf-image-helper's Issues

Did the script stop working?

I've used it for a week or so, but I noticed that it stopped working a few days ago, showing this error in Chrome:

image

Script doesn't work anymore

Hi,

I just tried to paste some images to my .tex file in the online version of Overleaf.
It seems that it doesn't work anymore.
Is it just in my browser or has anyone else the same problem?

Best regards,
Fabian

Could you also mention Firefox Tampermonkey in readme?

Hi,
I just noticed that this Tampermonkey addon is also available on Firefox. I tested it and it seems to work fine.
Could you also mention this in the script readme?

Anyway, great work. Thanks to you I can finally make notes in Overleaf as I previously did in Google Docs.

HTTP 422 Unprocessable Content Error

It seems that the uploadImage function is running into an error at the following line:

xhr.onreadystatechange = function () {

After that line is executed, the xhr.status variable becomes 422, and the function throws an error. I logged the lines before in the console:

        var xhr = new XMLHttpRequest();
        var domain = "https://www.overleaf.com";
        var path = document.location.pathname + "/upload?folder_id=" + _ide.fileTreeManager.findEntityByPath("assets").id + "&_csrf=" + csrfToken;
        var url = path;
        // var url = document.location.pathname + "/upload?folder_id=" + _ide.fileTreeManager.findEntityByPath("assets").id + "&_csrf=" + csrfToken;
        let formData = new FormData();
        formData.append("qqfile", imageBlob, "my_image.png");
        xhr.open("POST", url, true);
        // xhr.setRequestHeader("Content-Type", "application/json");
        console.log('imageBlob:', imageBlob);
        console.log('hash:', hash);
        console.log('url:', url);
        console.log('formData:', formData);
        formData.forEach((value, key) => {
            console.log(key + ': ' + (value instanceof File ? value.name : value));
        });
        console.log(xhr.status)
        xhr.onreadystatechange = function () {
            console.log(xhr.status)
            if (xhr.readyState === 4 && xhr.status === 200) {
                var json = JSON.parse(xhr.responseText);
                console.log(json)
                console.log(json.entity_id + " Asset created :)");
            }
        };

And I got this output:

image

I thought it might be server-side, but in the error description it says the client should update the request before sending again:

image

Any thoughts on how to proceed with this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.