Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onclick="$jq( '#search-results' ).msg( 'remove', this )"
- {
- "manifest_version": 2,
- "name": "Hello World!",
- "version": "1.0",
- "description": "My first Chrome extension.",
- "permissions": ["tabs", "<all_urls>"],
- "browser_action": {
- "default_icon": "icon.png",
- "default_popup":"popup.html"
- }
- }
- <!doctype html>
- <html>
- <head><title>activity</title></head>
- <body>
- <button id="clickactivity">click</button>
- <script src="mscript.js"></script>
- </body>
- </html>
- function injectTheScript() {
- chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
- // query the active tab, which will be only one tab
- //and inject the script in it
- chrome.tabs.executeScript(tabs[0].id, {file: "content_script.js"});
- });
- }
- document.getElementById('clickactivity').addEventListener('click', injectTheScript);
- var links = document.getElementsByClassName("card-remove icon");
- for (var i=0; i<links.length; i++) {
- killMatch(links[i]);
- sleep(500);
- }
- function killMatch(link) {
- link.click();
- }
- function sleep(milliseconds) {
- var start = new Date().getTime();
- for (var i = 0; i < 1e7; i++) {
- if ((new Date().getTime() - start) > milliseconds){
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement