我不断收到此消息
"我们会定期审核Chrome网上应用店中的商品是否合规 我们的计划政策确保为我们提供安全可靠的体验 用户。你的物品" $ myitem" $ mycode正在被取消 违反了与之相关的开发者计划政策部分 恶意产品混淆了代码的一部分。按我们的 在可能的情况下,政策会尽可能多地显示您的代码 尽可能包装。如果您的某些应用程序的逻辑被隐藏了 似乎是可疑的,我们可能会将其删除。"
要恢复您的项目,请进行必要的更改 确保:
所有文件和代码都包含在项目包中。
包内的是人类可读的(没有混淆或缩小的代码)。
避免请求或执行远程托管代码(包括 引用远程javascript文件或执行XHR获取的代码 请求)。"所有代码
我重写了我的代码以遵守所有这些并且我仍然继续得到这个
这是我的代码
function SuperM(){
this.disabled = false
this.$about = false
this.init = function(){
//verefying script tool runs only once
if(typeof contextPreContext != 'undefined')
return
contextPreContext = true
me.loadingAssets()
$( window ).scroll(function() {
if(typeof me.$sm != "undefined")
me.$sm.remove()
});
document.addEventListener('click', me.openToolMenu);
$(document).keyup(function(e) {
if (e.keyCode == 27) { // escape key maps to keycode `27`
me.$sm.remove()
}
if (e.keyCode == 121&& e.ctrlKey) { // escape key maps to keycode `27`
me.openPopup("https://translate.google.com/?q=", 761, 550)
}
});
//
me.selectFrominput()
$('a').hover(function(e){
console.log(e.ctrlKey)
if(e.ctrlKey) {
me.openToolMenu(e,0, $(this).text())
}
}, function(){
//me.$sm.remove()
})
}
this.loadingAssets = function(){
//Loading the about window HTML
//PLUGIN_ASSETS
$.get(chrome.extension.getURL("about.html"), function(d){
me.aboutTpl = d
})
//Loading the menu HTML
$.get(chrome.extension.getURL("menu.html"), function(d){
me.smTpl = d
})
//font awesome
var fa = document.createElement('style');
fa.type = 'text/css';
fa.textContent = '@font-face { font-family: FontAwesome; src: url("'
+ chrome.extension.getURL('font-awesome/fonts/fontawesome-webfont.woff')
+ '"); }';
document.head.appendChild(fa);
$('<link rel="stylesheet" href="'+chrome.extension.getURL('font-awesome/css/font-awesome.css')+'">')
.appendTo('body');
//END_PLUGIN_ASSETS
}
//Get the hightlight text
this.getSelected = function(e){
var html=window.getSelection().toString()
if(!html)
html='';
if(html.length>500)
html=html.substr(0,500)
return html.replace(/\s+/g,' ').replace(/^\s+|\s+$/g,'');
}
//Set the menu position
this.pos = function(ev,el){
var fontsize=parseInt($(ev.target).css("font-size").replace("px",""))
var left=ev.pageX-$(document).scrollLeft();
var dirx="W"
dirx=(ev.pageX>innerWidth-el.width())?"E":"W"
//Make some delta between the menu and the text
if(dirx=="W")
left-=50
else
left-=el.width()-50
var top=ev.pageY-$(document).scrollTop();
var diry=(top>$(window).height()-el.height()-62)?"S":"N";
if(diry=="N")
top+=15+fontsize
else
top-=35+el.height()+fontsize
//Set the menu position
el.addClass("contextPre"+diry+dirx)
el.css('top',top);
el.css('left',left);
},
//Use the url to open popup
this.openPopup = function(url,width, height){
//close previus popup if exist
if(me.popup!=undefined)
me.popup.close()
//Encoding the text
var q=encodeURIComponent(me.text.toLowerCase().replace(/^[\s\!@#\$%\^&\*\(\)\-_=\+\[\]{}\\\/]+|[\s\!@#\$%\^&\*\(\)\-_=\+\[\]{}\\\/]+$/g,''))
.replace(/'/g,"%27")
url = url.replace("[q]", q)
//getThe text language and use it in the url if needed
var lang = "en"
guessLanguage.info(me.text, function(info) {
if(info[0] !== "unknown") {
lang = info[0]
}
});
url = url.replace("[lang]", lang)
//open the popup
me.popup=window.open(url,"popup","height="+height+", left="+(innerWidth/2-200)+",scrollbars=no, width="+width+", top="+(innerHeight/2-290)+", menuba=0,location=0,status=0,titlebar=0,toolbar=0")
return;
}
this.openToolMenu = function(e, isDB, selection){
if(me.$sm!=undefined)
me.$sm.remove()
if(selection)
me.text = selection
else{
var q = me.getSelected(e)
if(q)
me.text = q
else
return
}
if(me.$sm!=undefined)
me.$sm.remove()
if(selection == undefined) {
if(!e.ctrlKey||e.which!=1||e.target.tagName=="EMBED"||!me.text||me.disabled){
return;
}
}
me.$sm = $(me.smTpl)
setTimeout(me.menuHandler)
me.pos(e, me.$sm)
}
// append the menu to the body and handle menu events
this.menuHandler = function(){
me.$sm.appendTo("body")
.find('.contextPreSelItm')
.click(me.menuEvents)
me.$sm.find('.contextPrex')
.click(me.closeMenu)
me.$sm.find('.contextPrehelp')
.click(me.openAbout)
$('.hideSmForSession').click(function(){
me.disabled = true
})
}
//Take the menu.html's item parameters and openPopup
this.menuEvents = function(e){
e.preventDefault();
e.stopPropagation();
me.openPopup($(this).attr("url"), $(this).attr("width"), $(this).attr("height"))
}
this.closeMenu = function(e){
e.preventDefault();
e.stopPropagation();
$('.contextPresmhidemenu').show()
}
this.openAbout = function(e){
e.preventDefault();
e.stopPropagation();
if(!me.$about)
me.$about = $(me.aboutTpl)
.appendTo("body")
me.$about.find(".contextPreclose")
.click(function(){
me.$about.remove()
me.$about = false
})
.after("<img src='"+chrome.extension.getURL("icon.png")+"' class='contextPre-reset'>")
}
this.selectFrominput = function() {
$('input,textarea').click(function(e){
if(e.which!=1 || !e.ctrlKey)
return
// obtain the index of the first selected character
var start = $(this)[0].selectionStart;
// obtain the index of the last selected character
var finish = $(this)[0].selectionEnd;
// obtain the selected text
var sel = $(this)[0].value.substring(start, finish);
console.log(sel)
me.openToolMenu(e,0, sel)
})
// do something with the selected content
}
var me = this
this.init()
}
//LOADING_LIBS
new SuperM();
//END_LOADING_LIBS
&#13;
这是我的manifest.json:
{
"manifest_version": 2,
"name": "Context",
"description": "Context is a menu that opens when one press CTRL & highlight text. It allows to explore the hightlited text without leaving the site",
"version": "1.10",
"icons": { "16": "icon16.png",
"32": "icon32.png",
"128": "icon.png" },
"web_accessible_resources": [
"font-awesome/css/*",
"font-awesome/fonts/*",
"about.html",
"menu.html",
"icon.png"
],
"content_scripts": [
{
"matches": ["http://*/*","https://*/*"],
"css": ["style.css"],
"js": [ "jquery.js", "guessLanguage.js","context.js"],
"run_at": "document_end"
}
],
"permissions": [
"activeTab",
"tabs",
"http://*/*",
"http://*/*"
]
}
&#13;
这是我的应用截图
先谢谢
答案 0 :(得分:2)
Chrome网上应用店可能有一个机器人,它会查看代码并使用某个公式来猜测某个扩展程序很有可能是恶意的。你的代码中有些东西被这个机器人拾取并标记为“恶意”。
来自Chrome的Developer Program Policies页面:
恶意产品:不要传播病毒,蠕虫,缺陷,特洛伊木马,恶意软件或任何其他具有破坏性的项目。我们不允许内容损害或干扰Google或任何第三方的网络,服务器或其他基础架构的运营。 Chrome网上应用店中也禁止使用间谍软件,恶意脚本和密码网络钓鱼诈骗。在可能的情况下,尽可能多地在包中显示您的代码。如果某些应用的逻辑被隐藏且看起来很可疑,我们可能会将其删除。
基本上,Google认为您的代码隐藏了某些内容,因为它的编写方式。我可以提出的一些提示: