-2

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

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

我目前正在编辑 8.3 版,但运气不佳。请求的主要文件是:

清单.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
}

背景.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_options_handler_script.js

'use strict';

// This method adds appropriate event handlers for each of the UI elements in the options menu
// Options menu is written in html in c2c_options_menu.html
function addEventHandlers() {
    document.addEventListener('DOMContentLoaded', function () {
        localizer.loadLocalizedResources();
        var switchHighlightElement = document.getElementById('switchHighlight');
        var notification = document.getElementById('notification');
        if (JSON.parse(window.localStorage.getItem('switchState')) === false) {
            if (JSON.parse(window.localStorage.getItem('displayNotification')) === true) {
                document.getElementById('notification').classList.remove('noDisplay');
                window.localStorage.setItem('displayNotification', false);
            }
        }
        switchHighlightElement.addEventListener('click', function() { switchHighlightHandler(switchHighlightElement.checked); });
    });
}

// Handle the switch on/off highlight event from UI
// Send the message to background script to store the settings
function switchHighlightHandler(onOffState) {
    var message = {};
    message.op = 'SET_SETTINGS_REQUEST';
    message.switchState = onOffState;
    chrome.extension.sendMessage(message);
}

// Sets the highlighting on/off check box state
function setSwitchState(message) {
    if ( message.switchState === false ) {
        document.getElementById("switchHighlight").checked = false;
    }
    else {
        document.getElementById("switchHighlight").checked = true;
    }
}

function main() {

    // Add event handlers for UI elements
    addEventHandlers();

    // Update the settings displayed in the panel to match the stored settings
    chrome.extension.sendMessage({op: 'GET_SETTINGS_REQUEST'}, function(message) {
        setSwitchState(message);
    });
}

main();

c2c_options_menu.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>

好吧,所以我完全忘记了微软开发的一个名为 Skype Click to Call 的应用程序,它与 Skype 网络扩展程序密切合作。他们不再支持它,所以我无法从他们的网站正式下载它,但在softpedia上找到了该软件。

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

该软件还会自行随机卸载。

4

2 回答 2

0

我想通了并解决了这个问题。最新版本的 Skype (7.28/29) 停止支持并完全删除 Skype Click-to-call,它在 Skype 安装时默认安装。

我将 Skype 降级到 7.16 版,禁用 Skype 更新,以及禁用/停止 Skype 点击通话更新程序和 Skype 更新程序的服务。

Skype Web 扩展 8.3 和 Skype 版本 7.16 运行良好。(突出显示网页上的电话号码,并让用户通过 Skype 点击通话。)

于 2016-10-27T12:12:09.190 回答
0

如果您将下面的代码添加到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);
于 2016-10-26T02:00:44.813 回答