टी एल; डॉ वेबस्टोर एक्सटेंशन ने लिखी नहीं किया जा सकता है, और झंडा है कि पहले आपको लगता है कि (--allow-scripting-gallery
) has been removed in Chrome 35 करने की अनुमति दी।
क्रोम एक्सटेंशन सामग्री स्क्रिप्ट निष्पादित नहीं कर सकते/सीएसएस को क्रोम वेब स्टोर सम्मिलित नहीं कर सकते हैं। यह the source code में स्पष्ट रूप से परिभाषित किया गया है, फ़ंक्शन IsScriptableURL
पर (पूर्ण तर्क देखने के लिए पिछले लिंक पर क्लिक करें)।
// The gallery is special-cased as a restricted URL for scripting to prevent
// access to special JS bindings we expose to the gallery (and avoid things
// like extensions removing the "report abuse" link).
// TODO(erikkay): This seems like the wrong test. Shouldn't we we testing
// against the store app extent?
GURL store_url(extension_urls::GetWebstoreLaunchURL());
if (url.host() == store_url.host()) {
if (error)
*error = manifest_errors::kCannotScriptGallery;
return false;
}
manifest_errors::kCannotScriptGallery
परिभाषित किया गया है here: जब आप chrome.tabs.executeScript
का प्रयोग कर एक वेब स्टोर टैब में एक स्क्रिप्ट सुई
const char kCannotScriptGallery[] =
"The extensions gallery cannot be scripted.";
त्रुटि पृष्ठभूमि पृष्ठ के कंसोल में देखी जा सकती है। उदाहरण के लिए, खुला https://chrome.google.com/webstore/, तो निम्न स्क्रिप्ट एक विस्तार की पृष्ठभूमि पेज में (कंसोल के माध्यम से, लाइव डीबगिंग के लिए) निष्पादित करें:
chrome.tabs.query({url:'https://chrome.google.com/webstore/*'}, function(result) {
if (result.length) chrome.tabs.executeScript(result[0].id, {code:'alert(0)'});
});
स्रोत
2012-07-23 14:22:09
ठीक सामग्री स्क्रिप्ट काम नहीं कर रहा है, वहाँ हो सकता है पृष्ठभूमि पृष्ठ के माध्यम से एक रास्ता है? या इस काम को पाने के लिए कोई संभावित तरीका नहीं है (कमांड लाइन पैरामीटर के माध्यम से छोड़कर) – chingo
यह अब और काम नहीं कर रहा है (क्रोम 31 में)। मैंने एक बग सबमिट किया - https://code.google.com/p/chromium/issues/detail?id=342090 – kzahel
@kzahel मैंने बस उस बग को ठीक कर दिया है। आपको फिर से '--allow-scripting-gallery' का उपयोग करने में सक्षम होना चाहिए (कम से कम कैनरी बिल्ड के साथ)। –