NV / chrome-devtools-autosave

Auto-saving CSS and JavaScript changes from the Chrome Developer Tools
MIT License
1.05k stars 90 forks source link

Can't add new projects after update Chrome 45.0.2454.85 #97

Closed pen18 closed 8 years ago

pen18 commented 8 years ago

The drag function stopped working after update Chrome 45.0.2454.85 ? Please help me or tell me alternative.

2015-09-13 13 55 00

AFlorencia commented 8 years ago

The same happens to me. Trying Tincr

pen18 commented 8 years ago

I used Tincr before Devtools Autosave. But Tincr didn't become working. I'm trying workspaces now.

AFlorencia commented 8 years ago

Yes, I noticed the same. Learning to use workspaces now. Good luck!

kmsdevnet commented 8 years ago

I had the same issue. What I did is modify the options.js file to "avoid" the error. I am happy to say that it's working as it should do it.

So, step one: download the project from github.

Then modify the options.js file, go to the line 528 (Object.defineProperty(SVGGElement.prototype, 'x'.....) and prepend this:

if( this.dataset === undefined ) this.dataset = {};

to the set() method.

Do the same with the next method (Object.defineProperty(SVGGElement.prototype, 'y'....).

To finish follow the instructions at http://superuser.com/a/247654/327682.

I had just to declare the dataset object, that (I don't know why) is undefined.

Complete changed code:

Object.defineProperty(SVGGElement.prototype, 'x', {
    get: function() {
        if (typeof this.dataset.x === 'undefined') {
            var matched = this.getAttribute('transform').match(/translate\(([\d.]+),[\d.]+\)/);
            this.dataset.x = matched ? matched[1] : 0;
        }
        return parseInt(this.dataset.x);
    },
    set: function(x) {
        if( this.dataset === undefined ) this.dataset = {};
        this.dataset.x = x;
        this.setAttribute('transform', 'translate(' + x + ',' + this.y + ')');
    }
});

Object.defineProperty(SVGGElement.prototype, 'y', {
    get: function() {
        if (typeof this.dataset.y === 'undefined') {
            var matched = this.getAttribute('transform').match(/translate\([\d.]+,([\d.]+)\)/);
            this.dataset.y = matched ? matched[1] : 0;
        }
        return parseInt(this.dataset.y);
    },
    set: function(y) {
        if( this.dataset === undefined ) this.dataset = {};
        this.dataset.y = y;
        this.setAttribute('transform', 'translate(' + this.x + ',' + y + ')');
    }
});

Regards.

NV commented 8 years ago

Fixed in 1.2.4. The extension should update automatically.

@kmsdevnet thank you for explaining what was broken.

kmsdevnet commented 8 years ago

I am glad to help. This is a great utility after all :smile: