I'm developing a chrome extension that improves youtube functionality by injecting a script. The problem is, if I open a new tab and open a Youtube video for the first time, the script does not run until I REFRESH the page once. Does anyone have knowledge of similar problems/solutions?
Thanks!
I faced this problem but I passed the tab.id to the tabs.executeScript,then it is working fine.
Related
I also try extension in my browser but it does not work.
I am using Kiwi browser. It's much similar to Chrome browser with some additional features one of is using extension. I'm trying almost every extension to know my web time spent on each website but it does not work.
I am also use Firefox browser but web time tracker didn't work.
Please note that I am talking about browser in my smartphone.
Have you tried using the 'timeyourweb' chrome extension. At a glance, it gives you the time spent on tabs. Check it out here : https://chrome.google.com/webstore/detail/timeyourweb-time-tracker/kfmlkgchpffnaphmlmjnimonlldbcpnh?hl=de&gl=US
I am working on a webpage and it works fine on Safari on iPhone. However, when the page is opened in WeChat (opened by clicking a link in chat), it has some problems.
Because the problems only exist in WeChat, I was wondering is there a way to simulate the WeChat so that I can debug it?
Otherwise I can only make some changes in code, then deploy, then view it in WeChat, which is very inefficient.
Based on comment, I provide the actual problem here:
I'm using Slick in my page. In WeChat, when I swipe slides, there is obvious lagging.
Thank you!
You can use wxdebugeer tool provided by wechat for debugging.
Link : Wechat tool
Whatever the problem related to webpage development for wechat can be tested using this.
As shown in the image here:
Why would Chrome require a user to manually “Reload” an extension? The extension seems to be working for a while, then suddenly a user reports that it has stopped working and I have to instruct him/her to click the “Reload” link.
As an extension developer, I would like to be able to prevent this from happening. Here’s my extension in the Chrome Web Store.
Screenshot borrowed from a similar report from another developer.
I tried everything but nothing seems to work for me. I tried to detect the closing of the browsing by detecting window closing like the code below but that does not work for me. What am I doing wrong and is there another solution to detect Chrome closing?
chrome.windows.onRemoved.addListener(function(windowId){
alert("Browser exit!");
});
Your general problem is that quitting the browser means that browser can no longer run your script to check if it has quit yet -- it's like trying to ask a person if they've died: the answer (if you get one) is only ever going to be "no".
One solution you might try is a long-running background page with the background permission:
Makes Chrome start up early and and shut down late, so that apps and extensions can have a longer life.
When any installed hosted app, packaged app, or extension has "background" permission, Chrome runs (invisibly) as soon as the user logs into their computer—before the user launches Chrome. The "background" permission also makes Chrome continue running (even after its last window is closed) until the user explicitly quits Chrome.
This permission allows the Chrome to keep running your extension even after all browser windows have closed. Normally, Chrome can only do things when it has windows open, so we run into the problem of Chrome being unable to detect when all windows have closed (as explained above). With the background permission, Chrome retains the ability to run extension code even when all windows have closed.
i'm just looking to get control when my extension exits not the entire browser; my extension uses a text box exclusively, so i set its onblur property to a function and put my exit code there; probably not what you're looking for, but it works for me!
the chrome developer website recommends not using background pages due to "memory and other resources they consume";
i agree a more consistent way to get control on extension exit would be useful; it is an html page that otherwise seems integrated with the dom;
chrome does not provide any API to detect chrome browser is going close. However, we can detect chrome browser opening event inside background page when using chrome extension.
background.js
chrome.runtime.onStartup.addListener(function () {
console.log("extension started: " + Date.now());
});
this event will fire when chrome browser will start. next you can use any trick to identify the chrome browser was exit.
Is there a way to detect if a particular tab was POSTed to via a Google Chrome extension? I am working on an extension that includes an "undo closed tab" type of function and would like to handle tabs which were POSTed to differently than GET pages.
I believe a solution exists in chrome.webRequest.onBeforeRequest via the 'method' return parameter. I will report back with a working code example once I have time to try this out.