Windows Phone 7/8注入地圖:鏈接和電話:鏈接到頁面DOM。這些注入的鏈接也改變了DOM:它將原始HTML文檔中的空格轉換爲&amp;並換行成<br>標籤,然後將這些標籤封裝在錨中。瀏覽器在檢測地址時似乎也有誤報,它將無序列表中的元素轉換爲map:link。Windows Phone IE Mobile - 您如何禁用創建的自動地址(地址和電話號碼)?
我想完全禁用此功能(如果可能的話)。
<!doctype html>
<html>
<head>
<!--<meta name="format-detection" content="none"/>-->
<!--<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">-->
<!--<script type="text/javascript">-->
<!--document.execCommand('AutoUrlDetect', false, false);-->
<!--</script>-->
</head>
<body>
<div>
<p>
9380 W. Glendale Ave.<br />
Glendale, AZ 85305-9400
</p>
<!--<p x-ms-format-detection="none">-->
<p>
623-872-6700
</p>
</div>
<ul>
<li>Quicker Checkout</li>
<li>Order History/Track Your Order</li>
<li>Create an Address Book</li>
<li>Manage CLUB/Credit Cards</li>
<li>Create a Wish List</li>
<li>Write Customer Product Reviews</li>
<li>Access Your Account Anywhere</li>
</ul>
</body>
</html>
此代碼將產生以下輸出: Output image
頁有這些鏈接補充說:
<a href="maps:9380%20W.%20Glendale%20Ave.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Glendale,%20AZ%2085305-9400">9380 W. Glendale Ave.<br> <br>Glendale, AZ 85305-9400</a>
<a href="tel:6238726700">623-872-6700</a>
正如你可以看到它在轉換的空間戰爭HTML轉化爲& nbsp;它很難看到,但它也在原始HTML中增加了\ n的額外<br>。
我不能簡單地從源文件中刪除空格和\ n,因爲大部分數據都是在許多設備和非移動網站上使用的託管內容。
目前我已經在很多組合中嘗試過這些。
<meta name="format-detection" content="none"/>
<meta name="format-detection" content="telephone=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1"> <- and many combinations
document.execCommand('AutoUrlDetect', false, false);
<p x-ms-format-detection="none">
我試圖檢測變化,通過JS突變事件發生,但它出現的瀏覽器時,它這些變化不發送任何事件。
不幸的是,內容格式化需要維護。 – bheads