2013-10-15 103 views
0

良好的一天,善良的人..Chrome扩展程序Popup.html很慢打不开? 5秒1.89kb页

我要问这是为什么..

我为我的网站一个简单的Chrome扩展。它有以下代码,但是当我点击图标时,需要大约3-5秒,为什么不立即打开?

基本上Popup.html包含一个iframe,它从谷歌驱动器加载一块网页,但它需要太多时间我想在线发布,但谁会喜欢这样慢的扩展?

iframe中包含谷歌自定义搜索框和一个小型

看到代码,请。帮助e为什么它很慢?

Popup.html

<html> 
<head> 

</head> 
    <body> 
     <iframe width="400" height="400" name="iframe" seamless="seamless"src="https://googledrive.com/host/xxxxxxxxxxx/xxxxx.html"></iframe> 
    </body> 

</html> 

manifest.json的

{ 
    "name": "Instant Quotes!", 
    "description": "Search Quotes Instantly!", 

    "version": "0.1", 
    "manifest_version": 2, 
    "browser_action": { 
     "default_popup": "popup.html", 
     "default_icon": "icon.png", 
     "default_title": "Instant Quotes!", 
     "icons": 
     { 
      "48": "icon48.png", 
      "128": "icon_128.png" 

     }, 
      "app": { 

    "launch": { 
     "web_url": "http://RationalQuotes.com/" 
    }} 

    } 

} 

的iframe页面

<!DOCTYPE html> 

<html> 
<head> 

    <style> 
.cse input.gsc-input, input.gsc-input {background-image:'none') ! 

    important;background-repeat:no-repeat;background-position:right; }::-webkit-scrollbar{ width: 10px; /* for 

    vertical scrollbars */ height: 50px; /* for horizontal scrollbars */}::-webkit-scrollbar-track{ rgba(0, 152, 199, 

    0.8);}::-webkit-scrollbar-thumb{ background: rgba(0, 162, 69, 0.9);} 
    </style> 

    <title></title> 
</head> 

<body> 
    <script> 
(function() 

    { var cx = '009043xxxxxxxxxxx88903:ntz9xxxxxxbzw'; var gcse = document.createElement('script'); gcse.type = 

    'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + 

    '//www.google.com/cse/cse.js?cx=' + cx; document.body.appendChild(gcse); }) 

     (); 
    </script> <span style="font-size:10px;">OR</span> 

    <form> 
     <span style="font-size:10px;">Book: <input id="value1" type="text"> (1 
     to 200)<br> 
     Page : <input id="value2" type="text"> (Depends)<br> 
     <input onclick="redirect()" style="width:95px" type="button" value= 
     "Meaning!"> <input onclick="Quotes()" style="width:96px" type="button" 
     value="Quote!"></span> 
    </form><span style="font-size:10px;"><script> 
function tafsir() { window.location.assign 

    ("http://www.example.com/xyz/abc/" + document.getElementById("value1").value + "/index.html");} 

    </script><script> 
function redirect() { window.location.assign("http://example.com/xyz/" + 

    document.getElementById("value1").value + "/" + document.getElementById("value2").value + 

    "/printview.html");} 
    </script></span><span style="font-size:10px; color:#008000;">(Note: Page 
    No. is Compustory for Qoutes)</span><span style="font- size:8px;"><a href= 
    "http://example.blogspot.com" target= 
    "_blank">RationalQoutes.com</a></span><br> 
</body> 
</html> 
+0

如果您在'popup.html'中注释掉iframe行,需要多长时间? – yakiang

+0

你不能只把iframe的代码放在弹出窗口中吗? –

回答

-2

修改清单.json

"background": { 
"page": "popup.html" 
}, 
+0

[后台页面](https://developer.chrome.com/extensions/background_pages)!= [弹出页面](https://developer.chrome.com/extensions/browserAction#popups) –

相关问题