Merge pull request #744 from zerodogg/linux-webkit-background-workaround

Added a workaround for Linux webkit browsers
This commit is contained in:
Samuel Clay 2015-09-06 15:31:46 -07:00
commit cc50693b18

View file

@ -123,7 +123,16 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({
open_story_in_new_tab: function(background) {
this.mark_read({skip_delay: true});
if (background && !$.browser.mozilla) {
// A «Safari» browser on Linux is an impossibility, and thus we're actually
// on a WebKit-based browser (WebKitGTK or QTWebKit). These can't handle
// background tabs. Work around it by disabling backgrounding if we
// think we're on Safari and we're also on X11 or Linux
if($.browser.safari && /(\(X11|Linux)/.test(navigator.userAgent))
{
background = false;
}
if (background && !$.browser.mozilla && trueSafari) {
var anchor, event;
anchor = document.createElement("a");
@ -507,4 +516,4 @@ NEWSBLUR.Collections.Stories = Backbone.Collection.extend({
}
}
});
});