2015-06-05 77 views
0

我正在使用來自http://browser-update.org/#install的瀏覽器更新。我正在嘗試自定義用戶看到的文字。 「您正在使用舊版本的Internet Explorer ...」。我似乎無法得到瀏覽器的名字出現在定製mesage如何設置瀏覽器更新腳本標記以顯示它正在使用的瀏覽器的名稱?

我使用的JavaScript代碼是:

var $buoop = { 
vs: {i:8,f:35,o:25.63,s:7,c:10}, // browser versions to notify 
reminder: 0,     // atfer how many hours should the message reappear 
           // 0 = show all the time 
reminderClosed: 0,    // if the user closes message it reappears after x hours 
onshow: function(infos){},  // callback function after the bar has appeared 
onclick: function(infos){},  // callback function if bar was clicked 
onclose: function(infos){},  // 

l: false,      // set a language for the message, e.g. "en" 
           // overrides the default detection 
test: false,     // true = always show the bar (for testing) 
text: "You're using an old version of vs We recommend you <a href='http://browsehappy.com/' target='_new'>upgrade your browser</a> for a better experience using this and other websites. ",      // custom notification html text 
newwindow: true     // open link in new window/tab 
}; 

function $buo_f(){ 
    var e = document.createElement("script"); 
    e.src = "//browser-update.org/update.min.js"; 
    document.body.appendChild(e); 

}; 

try {document.addEventListener("DOMContentLoaded", $buo_f,false)} 
catch(e){window.attachEvent("onload", $buo_f)} 
+0

爲什麼訪客會隨時關注隨機網站對瀏覽器的評價?這是網絡,處理它。 – RobG

+0

我想在信息消息上顯示瀏覽器名稱。那可能嗎? –

回答

0

我解決它。你需要使用%s。顯然它不在開發者手冊上,我只是試驗和錯誤。所以代碼將如下所示

text: "You're using an old version of %s We recommend you <a href='http://browsehappy.com/' target='_new'>upgrade your browser</a> for a better experience using this and other websites. ", 
相關問題