How to prevent phone numbers to be converted into Skype links?

后端 未结 14 699
猫巷女王i
猫巷女王i 2020-12-13 02:08

On those Windows machines with Skype installed, it tends to convert all phone-formatted numbers to Skype links so you can click it in order to make a call on Skype.

相关标签:
14条回答
  • 2020-12-13 02:21

    You can also leave the number alone and remove it with JS.

    jQuery(document).ready(function(){jQuery('.skype_pnh_container').parent().html('(555) 222 - 3333');
    jQuery('.skype_pnh_container').remove()}
    

    It is harder to do in normal HTML, but Skype doesn't remove the parent container, so put the number in something with an ID, you can do a "getElementById" on it, set the innerHTML to the phone number.

    document.getElementById('phoneNumberContainer').innerHTML='(555) 222 - 4444';

    0 讨论(0)
  • 2020-12-13 02:25

    All you need to do is insure your CSS selector is more specific than the selector Skype uses. In the current skype style sheet they use:

    span.skype_pnh_container span.skype_pnh_highlighting_inactive_common span.skype_pnh_text_span {...}
    

    You will need to add an extra class — your own website context — to this selector, i.e.

    .myclass span.skype_pnh_container span.skype_pnh_highlighting_inactive_common span.skype_pnh_text_span {...}
    
    0 讨论(0)
  • 2020-12-13 02:26

    I added a space in the first term of the number.

    Instead of (888) 222-3333 I entered ( 888 ) 222-3333

    Granted: may look weird, but it works and it is simple.

    0 讨论(0)
  • 2020-12-13 02:27

    <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />

    0 讨论(0)
  • 2020-12-13 02:28

    If you are using PhoneGap on iOS this can be a UIWebView issue (separate from Skype).

    The following line fixes the problem if you don't want automatic links generated in UIWebView:

    self.viewController.webView.dataDetectorTypes = UIDataDetectorTypeNone;
    

    inside AppDelegate.m in -(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions

    0 讨论(0)
  • 2020-12-13 02:32

    Update

    This answer is no longer accurate - see Daniel Byrne's answer for more information.


    Using CSS only, it can be removed by overriding the styles used by Skype. Try adding these two lines to your stylesheet:

    span.skype_pnh_container {display:none !important;}
    span.skype_pnh_print_container {display:inline !important;} 
    
    0 讨论(0)
提交回复
热议问题