Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing option to specify target for cordova compatibility #141

Open
davistan opened this issue Jan 1, 2016 · 3 comments
Open

Allowing option to specify target for cordova compatibility #141

davistan opened this issue Jan 1, 2016 · 3 comments

Comments

@davistan
Copy link

davistan commented Jan 1, 2016

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.

@BadSector82
Copy link

+1 please!

@gregjacobs
Copy link
Owner

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;
    }
} );

@c-jacquin
Copy link

+1 thx for the workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants