0
所以我正在爲我自己的個人使用製作一個Safari擴展程序,它根本不工作。 我試圖跳過adf.ly並直接進入網站。但它根本沒有做任何事情。 我試過提醒當前的URL和應該的新網址,它們甚至都沒有顯示。試圖建立safari擴展。不工作-.-
Global.html
<!DOCTYPE html>
<script type='application/javascript'>
// Skip Adf.ly
// Made by Austen Patterson
// For Safari
//(C) Copyright 2013 Austen Patterson.
safari.application.addEventListener("start", performCommand, true);
safari.application.addEventListener("validate", validateCommand, true);
// Function to perform when event is received
function performCommand(event) {
// Make sure event comes from the button
if (event.command == "skip") {
var url = this.activeBrowserWindow.activeTab.url;
var newurl = url.replace(/http:\/\/adf\.ly\/(\d+)\//, '');
location.href(newurl);
window.open(newurl,"_self");
return;
}
}
</script>
,這裏是我的分機建設者設置。