kgn / Rededit

A Safari extension that adds features to the Reddit website, and a bar which provides Reddit information about the active webpage.
http://inscopeapps.com/#rededit
MIT License
0 stars 0 forks source link

TypeError: Result of expression 'tab.url' [undefined] is not an object. #21

Open kgn opened 14 years ago

kgn commented 14 years ago

I am not sure what is causing this, it is rare though. Scripts/Bar.js:107

    var tab = safari.self.browserWindow.activeTab;

    //submit story
    if(typeof(json) === 'undefined' || typeof(json.data.children[0]) === 'undefined'){
        //if the url is from imgur try striping off 'i.'
        if(tab.url.indexOf('imgur.com') >= 0){
            imgurUrl = tab.url.match(/http:\/\/i\.(imgur.com.*)/i);
            if(imgurUrl){
                this._updateWithUrl('http://'+imgurUrl[1]);
                return;
            }
        }