Javascript Chrome-网络Skype扩展-不在网页上突出显示电话号码

Javascript Chrome-网络Skype扩展-不在网页上突出显示电话号码,javascript,java,google-chrome-extension,skype,skypedeveloper,Javascript,Java,Google Chrome Extension,Skype,Skypedeveloper,我只使用它的点击通话的目的。它突出显示了网页/平台上的电话号码,您可以通过Skype单击并立即拨打这些号码。 可悲的是,他们不再支持这个“数字突出显示”功能,要有效地完成我的工作真的很麻烦。许多货运调度员对此也有同样的问题 我曾经找到过此扩展的旧版本。 版本8.4+没有“数字突出显示”复选框选项,但版本8.3和更低版本有。我想出了一个解决这个奇怪问题的办法。(安装了最新版本的扩展,删除了它,然后安装了8.4版,删除了它,最后安装了8.3版。8.3版显示了“号码突出显示选项”,如果您在其中打勾,它

我只使用它的点击通话的目的。它突出显示了网页/平台上的电话号码,您可以通过Skype单击并立即拨打这些号码。 可悲的是,他们不再支持这个“数字突出显示”功能,要有效地完成我的工作真的很麻烦。许多货运调度员对此也有同样的问题

我曾经找到过此扩展的旧版本。
版本8.4+没有“数字突出显示”复选框选项,但版本8.3和更低版本有。我想出了一个解决这个奇怪问题的办法。(安装了最新版本的扩展,删除了它,然后安装了8.4版,删除了它,最后安装了8.3版。8.3版显示了“号码突出显示选项”,如果您在其中打勾,它会显示电话号码。直接从最新版本升级到8.3版会出现chrome降级错误/问题。)

我目前正在编辑8.3版,但运气不太好。请求的主要文件如下:

manifest.json

{
"update_url": "https://clients2.google.com/service/update2/crx",

  "name" : "Skype",
  "version" : "8.3.0.9150",
  "description" : "Quickly access Skype for Web and Share on Skype through your browser",
  "background" : {
    "page": "background.html"
  },
  "options_page": "c2c_options_menu.html",
  "browser_action": {
    "default_icon": {
      "19": "skypelogo_19.png",
      "38": "skypelogo_38.png"
    },
    "default_title": "Skype",
    "default_popup": "browserActionPopup.html"
  },
  "permissions" : [
    "tabs",
    "https://pnrws.skype.com/",
    "https://c2c-directory-dev.trafficmanager.net/",
    "https://c2c-directory-pre.trafficmanager.net/",
    "https://c2c-directory-qa.trafficmanager.net/",
    "https://localhost:26143/"
   ],
  "icons" : {
    "16" : "skypelogo_16.png",
    "19" : "skypelogo_19.png",
    "38" : "skypelogo_38.png",
    "48" : "skypelogo_48.png",
    "128" : "skypelogo_128.png"
  },
  "content_scripts" : [
    {
      "matches" : [ "http://*/*", "https://*/*", "file://*/*" ],
      "js" : [ "jquery-2.1.0.min.js", "mutation-summary.js", "localization.js", "browserSpecificScript.js", "number_highlighting_builder.js", "pnr.js", "fpnr.js", "contentscript.js"],
      "css" : [ "number_highlighting.css", "number_highlighting_chrome.css" ],
      "run_at" : "document_end",
      "all_frames" : true
    }
  ],
  "web_accessible_resources": [
    "call_skype_logo.png", "call_icon.png", "menu_handler.js", "telemetry.js", "specificTelemetry.js"
  ],
  "manifest_version": 2
}
background.js

/* globals SkypeC2CTelemetry */
/**
This is the script run when the browser starts up and is not associated
with any tab. Here we create a add-on icon in the add-on bar to display
the options.
*/
'use strict';
/**
* Returns the product version number
*
* @return Product version number
*/
var getProductVersion = function() {
    return '8.3.0.9150';
};

/**
* Stores configuration information
*/
var Configuration = {
    configReady: '0',
    fingerPrint : '0',
    metricsUrl: 'https://pipe.skype.com/Client/2.0/',
    pushToMobileUrl: 'https://c2c-p2m-secure.skype.com/p2m/v1/push',
    lookupHost: 'pnrws.skype.com',
    uiId : 0
};

/**
* Queries configuration information from PNR service
*/
var queryConfig = function () {
    if (Configuration.configReady === '1') {
        // We already have configuration information
        return;
    }

    var ajaxReq = new XMLHttpRequest();
    ajaxReq.onreadystatechange = function () {
        if (ajaxReq.readyState === 4 && ajaxReq.status === 200) {
            var jsonData = JSON.parse(ajaxReq.responseText);

            if (jsonData.fp) {
                Configuration.fingerPrint = jsonData.fp;
            }
            if (jsonData.metrics_url) {
                Configuration.metricsUrl = jsonData.metrics_url;
            }
            if (jsonData.lookup_host) {
                Configuration.lookupHost = jsonData.lookup_host;
            }
            if (jsonData.pushtomobile_url) {
                Configuration.pushToMobileUrl = jsonData.pushtomobile_url;
            }
            if (jsonData.ui_id) {
                Configuration.uiId = parseInt(jsonData.ui_id);
            }
            Configuration.configReady = '1';

            // Ensure UI id is something we understand
            if (Configuration.uiId !== 0 && Configuration.uiId !== 1) {
                Configuration.uiId = 0;
            }
        }
    };

    ajaxReq.open('GET', 'https://localhost:26143/skypectoc/v1/pnr/config', false);

    // Send the request
    ajaxReq.send();
};

/**
* Sends metrics data
*/
var postMetrics = function(event, userKVPs) {

    if ( event === 'extension_state' ) {
        SkypeC2CTelemetry.post( Configuration.metricsUrl,
            event,
            false, {
                Fingerprint: Configuration.fingerPrint,
                UiId: Configuration.uiId.toString(),
                ReferrerUrl: userKVPs.url,
                Enabled: userKVPs.chosenFunction
            }
        );
    } else if ( event === 'help_page_click' ) {
        SkypeC2CTelemetry.post( Configuration.metricsUrl,
            event,
            false, {
                Fingerprint: Configuration.fingerPrint,
                UiId: Configuration.uiId.toString(),
                ReferrerUrl: userKVPs.url
            }
        );
    }
};

var openFaqTab = function() {
    chrome.tabs.create({
        url: 'https://go.skype.com/skype.extension.faq'
    });
};

var firstLaunchExperience = function() {
    var previousVersion = localStorage.getItem('skype_version');
    var newVersion = getProductVersion();
    if (!previousVersion){
        openFaqTab();
    } else {
        var newMajorVersion = parseInt(newVersion.split('.')[0], 10);
        var previousMajorVersion = parseInt(previousVersion.split('.')[0], 10);
        if (newMajorVersion && previousMajorVersion && (newMajorVersion > previousMajorVersion)) {
            openFaqTab();
        }
        if (previousVersion != newVersion) {
            switchOffHighlightingNotification();
        }
    }
    localStorage.setItem('skype_version', getProductVersion());
};

var switchOffHighlightingNotification = function(){
    var previousState = JSON.parse(window.localStorage.getItem('switchState'));
    if (previousState === null) {
        window.localStorage.setItem('switchState', false);
    }
    else if (previousState === true) {
        if (JSON.parse(window.localStorage.getItem('displayNotification')) === null) {
            window.localStorage.setItem('switchState', false);
            if (window.navigator.platform.toUpperCase().indexOf('WIN') >= 0) {
                window.localStorage.setItem('displayNotification', true);
                chrome.tabs.create({
                    url: 'c2c_options_menu.html'
                });
            }
        }
    }
};

/**
* Main function where all the action starts
*/
var main = function() {

    firstLaunchExperience();

    // Register listener to receive messages
    chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {

        if ( request.op === 'GET_SETTINGS_REQUEST' ) {
            var message = {};
            message.switchState = JSON.parse(window.localStorage.getItem('switchState'));
            if ( message.switchState === null ) {
                message.switchState = false;
            }

            if ( Configuration.configReady === '0' ) {
                message.switchState = false;
            }

            message.fingerPrint = Configuration.fingerPrint;
            message.metricsUrl = Configuration.metricsUrl;
            message.lookupHost = Configuration.lookupHost;
            message.pushToMobileUrl = Configuration.pushToMobileUrl;
            message.uiId = Configuration.uiId;

            sendResponse(message);
        }
        else if ( request.op === 'SET_SETTINGS_REQUEST' ) {
            // Save the settings
            window.localStorage.setItem('switchState', request.switchState);

            // Inform all tabs about change in settings
            request.fingerPrint = Configuration.fingerPrint;
            request.metricsUrl = Configuration.metricsUrl;
            request.uiId = Configuration.uiId;

            chrome.tabs.query({}, function(tabs) {
                for (var i = 0; i < tabs.length; ++i) {
                    chrome.tabs.sendMessage(tabs[i].id, request);
                }
            });
        }
        else if ( request.op === 'MENU_OPTION_CLICK') {
                var data = {
                    chosenFunction: request.option,
                    url: request.url.split('?')[0].split('#')[0]
                };
                postMetrics('extension_state', data);
        }
    });

    // Query configuration from PNR service
    queryConfig();
};

main();
c2c_选项_菜单.html

<!DOCTYPE html>
<html>
<head>
    <title>Skype</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="c2c_options_menu.css"/>
    <script src="c2c_options_menu_localization.js"></script>
    <script src="c2c_options_handler_script.js"></script>
</head>
<body>
    <header>
        <div id="notification" class="info noDisplay">
            <img src="info.png" alt="">
            <span class="message">Number highlighting has been turned off. To enable number highlighting, please check the &#39;<strong>Turn number highlighting on</strong>&#39; option below.</span>
        </div>
    </header>
    <div class="body">
        <div class="title">
            <div class="logo">
                <img src="skypelogo_128.png" alt="Skype">
            </div>
            <div class="info">
                <div class="heading">
                    <h1>Skype</h1>
                </div>
                <div class="company-branding">
                    <strong>By Microsoft Corporation</strong>
                </div>
            </div>
        </div>
        <div class="about">
            <div class="description">
                <p>
                    Install the Skype extension for fast access to 'Skype for Web' and 'Share on Skype'  through your browser.
                    <BR/>
                    We'll be adding more features and supporting other browsers in future releases.
                    <BR/><BR/>
                    <B>Share on Skype</B>
                    <BR/>
                    Read a good article? Now you can share the web page directly with your Skype contacts using the Skype extension. Click on 'Share on Skype' to get started.
                    <BR/><BR/>
                    <B>Launch Skype</B>
                    <BR/>
                    Access the full Skype functionality offered by the Skype web client. Click on 'Launch Skype' to get started.
                    <BR/><BR/>
                    Please note that audio and video calling on Skype web client is currently not supported on Chrome OS and Linux.
                </p>
            </div>
            <a href="https://go.skype.com/skype.extension.faq" target="_blank">Learn more</a> <span>about the Skype Extension</p>

            <hr>
            <div class="click-to-call">
                <p>Enhance this extension by installing <a href="https://go.skype.com/ctc.features" target="_blank">Skype Click to Call</a> on Windows</p>
                <label>
                    <input id="switchHighlight" type="checkbox" name="checkbox"  value="On"/>
                    <span id="switchHighlightLabel">Turn number highlighting on</span>
                </label>
                <br/><br/>
                <a href="https://support.skype.com/category/SKYPE_CALLS_FROM_BROWSERS/" target="_blank">Learn more</a> <span>about Skype Click to Call </p>
            </div>
        </div>
    </div>
    <footer></footer>
</body>
</html>

视频电话
数字突出显示已关闭。要启用数字突出显示,请选中'和#39;选项如下。
视频电话
由微软公司提供

安装Skype扩展,以便通过浏览器快速访问“Skype for Web”和“在Skype上共享”。

在未来的版本中,我们将添加更多功能并支持其他浏览器。

在Skype上共享
读一篇好文章?现在,您可以使用Skype扩展直接与您的Skype联系人共享网页。单击“在Skype上共享”开始。

启动Skype
访问Skype web客户端提供的完整Skype功能。单击“启动Skype”开始。

请注意,目前Chrome操作系统和Linux不支持Skype web客户端上的音频和视频通话。

关于Skype分机


通过在Windows上安装来增强此扩展

打开数字高亮显示

关于Skype单击呼叫

好的,所以我完全忘记了微软有一个叫做Skype点击呼叫的应用程序,它与Skype网络扩展密切相关。他们不再支持它了,所以我无法从他们的网站上正式下载,但我在softpedia上找到了这个软件

数字现在突出显示,但没有任何功能。它不会叫任何东西,它只是突出显示。似乎我无法添加Skype点击通话软件的链接


软件本身也会不断被随机卸载。

如果您将下面的代码添加到background.js的末尾,它将模拟用户在加载扩展后几秒钟从选项页选择启用数字高亮显示

function turnOnNumberHighlighting(){
    let request = {
        op:'SET_SETTINGS_REQUEST',
        switchState: true
    };
    // Save the settings
    window.localStorage.setItem('switchState', request.switchState);
    // Inform all tabs about change in settings
    request.fingerPrint = Configuration.fingerPrint;
    request.metricsUrl = Configuration.metricsUrl;
    request.uiId = Configuration.uiId;

    chrome.tabs.query({}, function(tabs) {
        for (var i = 0; i < tabs.length; ++i) {
            chrome.tabs.sendMessage(tabs[i].id, request);
        }
    });
}
//Simulate the user making the change on the options page 5 seconds after done loading.
setTimeout(turnOnNumberHighlighting,5000);
功能开启次数高照明(){
让请求={
op:“设置请求”,
开关状态:正确
};
//保存设置
window.localStorage.setItem('switchState',request.switchState);
//通知所有选项卡有关设置的更改
request.fingerPrint=Configuration.fingerPrint;
request.metricsUrl=Configuration.metricsUrl;
request.uiId=Configuration.uiId;
chrome.tabs.query({},函数(tabs){
对于(变量i=0;i
我解决了这个问题。最新版本的Skype(7.28/29)已停止支持,并完全删除了Skype安装时默认安装的Skype点击通话

我将Skype降级为7.16版,禁用了Skype更新,以及禁用/停止了Skype点击呼叫更新程序和Skype更新程序的服务


Skype Web extension 8.3和Skype 7.16版工作正常。(在网页上突出显示电话号码,并允许用户通过skype单击呼叫。)

下次,请回答您的问题,而不是再次询问。如果你做后一个问题的次数足够多,你可能会被禁止提问(特别是如果问题的计票结果是否定的)。请将问题放在主题上:包括一个与问题重复的完整问题。通常,包括manifest.json、一些后台脚本和内容脚本。寻求调试帮助的问题(“为什么此代码不工作?”)必须包括:►想要的行为,►特定的问题或错误,以及►在问题本身中复制它所需的最短代码。没有明确问题陈述的问题对其他读者没有用处。请参阅:“如何创建”,以及.a manifest.json是Chrome扩展的一个非常重要的部分。它定义了所有事情是如何进行的,以及允许扩展做什么,等等。您在上一个问题中被问到了这一点。请在此处包含您的manifest.json。@Makyen,很抱歉。我把舱单放在原稿上了。
function turnOnNumberHighlighting(){
    let request = {
        op:'SET_SETTINGS_REQUEST',
        switchState: true
    };
    // Save the settings
    window.localStorage.setItem('switchState', request.switchState);
    // Inform all tabs about change in settings
    request.fingerPrint = Configuration.fingerPrint;
    request.metricsUrl = Configuration.metricsUrl;
    request.uiId = Configuration.uiId;

    chrome.tabs.query({}, function(tabs) {
        for (var i = 0; i < tabs.length; ++i) {
            chrome.tabs.sendMessage(tabs[i].id, request);
        }
    });
}
//Simulate the user making the change on the options page 5 seconds after done loading.
setTimeout(turnOnNumberHighlighting,5000);