chrome not letting me use sessions methods? - javascript

I am trying to display recent tabs in a extension that I am expanding on.
When I try to run this code;
chrome.sessions.getDevices(function(data) { console.log(data);});
I get this error;
TypeError: Cannot read property 'getDevices' of undefined
I have given my manifest.json "sessions" permissions and cannot figure out why it gives me this. Do I have to clear my chrome cache to reload permissions?

Related

chrome.devtools.panels.create is undefined

I'm trying to create a Chrome extension and want to in different ways interact with the devtools. To create a foundation I decided to follow this guide, however it doesn't seem to be working at all. The errors arrive from this piece of code:
chrome.devtools.panels.create(
"My Panel",
"/icons/star.png",
"/devtools/panel/panel.html"
).then((newPanel) => {
newPanel.onShown.addListener(handleShown);
newPanel.onHidden.addListener(handleHidden);
});
The errors:
Uncaught TypeError: Cannot read properties of undefined (reading 'then')
Ignoring unauthorized client request from null
A panel is successfully created however when trying to view it just says "It may have been moved, edited or deleted". If instead of doing then add a callback function. The TypeError is removed, but the Ignoring unauthorized client request persists.
This is my first time working with Chrome extensions or anything with devtools API, however I have not been able to find any sufficient help online.

Uncaught TypeError: Cannot read property 'clearData' of undefined

i got this error when i logged in as guest, but when i logged in as admin , i didn't found it, any solutions?
click here
Thank you
Have you installed the AntiCopy 1.8.2 Joomla Extension? I think this might be related to this...
I just installed it on one of my Joomla 3.6.2 website, setting restrictions on Guest and Public usergroups and get this error 3000+ times and keeps increasing. I disabled the plugin and reloaded the page, and no more errors. So it would appear that there is some issues with this plugin to disable right click, select and copy content.
It seems to add this code to the body tag: onload="setInterval('window.clipboardData.clearData()',20)" which seems to be the source of the error messages

Uncaught TypeError: Cannot read property 'innerHTML' of null when running JavaScript code in Bookmarklet

I am trying to run following code by saving it as Chrome bookmarklet.
javascript:(function(){var myslidetotal=document.evaluate('//*[#id="total-slides"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerHTML;
var myslideurl=document.evaluate('//*[#id="container"]/img', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.src;
myslideurl=myslideurl.substring(0,myslideurl.indexOf("/images/")+8);
for(var ii=0;ii<myslidetotal;ii++){var myslideuniqurl=myslideurl+ii+'.jpeg?dpr=1&fit=clip&w=768';window.open(myslideuniqurl); }
})();
But it gives me error.
VM1747:1 Uncaught TypeError: Cannot read property 'innerHTML' of null
But when I try running same code in console. It works perfectly.
Why is this anomaly while running code and how to rectify this.
Chrome's now getting better by not executing some JavaScript that manipulate DOM on the URLs using javascript: protocol. So, yea, this implementation will fail. :) It's a security feature.
More Information: Same Origin Policy.
But it works in Console...
Using the Chrome Developer Console (or any of the current F12 Developer Tools), one can even get your Cookies, Session Information, and Credentials. Console has full power. :) In simple terms, your JavaScript console is like your Admin Account for JavaScript in Web Sites.
Any Work Arounds?
No. But one can create an extension or UserScript and run it using TamperMonkey for Google Chrome. Firefox has an extension called GreaseMonkey.

How to solve "cannot read property 'push' of undefined" in Firebug Lite?

I'm using Chrome on OS X (Maverick) and got some issues opening Firebug Lite for testing an AngularJS application. There was a message:
cannot read property 'push' of undefined firebug-lite.js 30905
How can this problem be solved?
I've found the answer in a Firebug discussion group thread.
Firebug Lite stores some info about its activation in the browser's local storage. To clear the local storage and by that reset the activation information execute this via the devtools' command line:
window.localStorage.clear()

What does Permission denied to access object in Firebug's console (Firebug is a FF addon) using Firefox 17 (latest) version?

just wondering if someone have found seeing the following error in the firebug console, or any idea of what could it mean??
Does this has to do with a browser thing when having the same page opened in two tabs or something??
Have you fixed a similar problem??
What would be a way of ensuring this error is not thrown, is annoying to me :(
Would it have to be with the fact that the site requires cookies, javascript or any considerations you could suggest??
Error: Permission denied to access object
Error: Permission denied to access object
Error:
Error: Permission denied to access object
Error: Permission denied to access object
Error:
Reproducibility:
(6 errors in the console listed when loading a page in two tabs with FF)
Haven't tried other browsers.. This error appears to be unobtrusive, it does not stop any code from continuing, but I would love to get rid of it, or prevent it.. Thanks in advance for the help!! Much appreciated
Edit:
And now I get a new one, which might be the cause of the problem :(
Error in Protected Function !281
In addition:
#Pointy:
- yeah, Tested on FF 18. You are absolutely correct on that statement by the way ;) Thanks for the sanity check :)

Categories

Resources