Autolinker.js icon indicating copy to clipboard operation
Autolinker.js copied to clipboard

Allowing option to specify target for cordova compatibility

Open davistan opened this issue 9 years ago • 3 comments

Thanks for this plugin and I've found that to allow it to work in cordova / phonegap, we need to use target="_system" instead of _blank.

This is required in Cordova's InAppBrowser plugin. Perhaps can include an option to specify the target instead of just newWindow?

Thanks.

davistan avatar Jan 01 '16 08:01 davistan

+1 please!

BadSector82 avatar Feb 07 '16 12:02 BadSector82

Hey, interesting. Will see what I can come up with.

Here's a workaround for the meantime:

var html = Autolinker.link( "Test google.com", {
    replaceFn : function( autolinker, match ) {
        var tag = match.buildTag();  // returns an Autolinker.HtmlTag instance
        tag.setAttr( 'target', '_system' );

        return tag;
    }
} );

gregjacobs avatar Feb 15 '16 04:02 gregjacobs

+1 thx for the workaround

c-jacquin avatar Jul 26 '16 11:07 c-jacquin