I'm trying to create a chrome extension that simulates .mouseover()
event.
Here is a sample of the page that i'm trying to simulate that event.
<div class="hand card-stack" aria-disabled="false">
...
<div id="card-c181" class="card face-up ui-draggable">
<div class="face"></div>
<div class="back"></div>
</div>
...
</div>
when i put the mouse on those divs
the class value changes and i'm trying to write a script to detect the change of the class name automatically and my best idea was to simulate .mouseover()
so before i write the actual inject code i test them in chrome console and they work just fine but when i inject them they don't...
Here is my inject.js
$(document).ready(function(){
$(main);
});
function main()
{
x = $('.card.face-up.ui-draggable').mouseover();
alert("DONE");
}
Manifest.json
{
"name": "Testing",
"version": "1.0",
"manifest_version": 2,
"description": "Simulating mouseover",
"homepage_url": "http://example.com",
"background": {
"scripts": ["background.js", "jquery-1.12.4.js"] ,
"persistent": true
},
"browser_action": {
"default_title": "Inject!"
},
"content_scripts": [{
"js": ["jquery-1.12.4.js"],
"matches": ["https://*/*"]
}],
"permissions": [
"https://*/*",
"http://*/*",
"tabs"
]
}
So when i click on my extension button it just alerts and the mouseover don't work..
but in chrome console it works.
i've tried .mouseenter()
, .trigger("mouseover"),
.on` nothing worked in inject.js but in chrome console they works.