chrome.devtools.panels.create is undefined - javascript

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.

Related

Getting 'Uncaught TypeError: Cannot set property 'timestamp' of undefined' when using jQuery

I have an error which appear when I import jQuery lib only. I don't know what I can do. I know that it's coming from the file jquery.min.js.
Here is my simple page causing this error :
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
What I get from my console :
This error has nothing to do with jQuery or its CDN.
From the error log, you can see that the error originates from webspeed.js. Since you precise that you only import the jQuery script, this shows that this error originates from an extension.
The script tries to contact speedtest.net and the request gets blocked by CORB, thus throwing an uncaught error. This also gives a hint that the extension is made likely to be offered by speedtest.net or a related corporation. As #alon-eitan found, this is indeed the case: the speedtest extension includes such a script that has been known for triggering similar errors.
Pausing the extension or configuring it not to run on your website is likely to fix the error. I'd recommend removing it completely, as network speed analysis and much more can already be natively performed by Chrome thanks to Lighthouse.

Meteor - Error when loading/refreshing page: Exception from Tracker afterFlush function: undefined

As described above, I am getting an error and an empty page (but the layout including the navbar is there) is shown. This error always occurs, when I refresh the link via the browser or in case I access the link directly through the browser. Everything is fine, when I use my navigation bar to navigate through the templates. So, I can´t see any data after a real "load" of the page.
I am using Meteor Blaze on Windows.
Here is a screenshot:
Neither the picture, nor other data is shown.
I am not sure, if this is 100% the reason for that behavior, but always if this behavior occurs, I get this error message in the client console:
Exception from Tracker afterFlush function: undefined
and
TypeError: Cannot read property 'username' of undefined
at Blaze.TemplateInstance. (http://localhost:3000/app/client/templates/common/navigation.js?hash=142e989d312ba94a4b875a71e5e557bdd5255272:3:40)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3398:22
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744:12)
at fireCallbacks (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3394:12)
at Blaze.View. (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3487:5)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1845:14
at Object.Blaze._withCurrentView (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2271:12)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1844:15
at Object.Tracker._runFlush (http://localhost:3000/packages/tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:548:11)
at onGlobalMessage (http://localhost:3000/packages/meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:398:23)
undefined
I searched for tracker, afterFlush etc., but I am not sure what I have to change in my code?
When you load this route "fresh" (using a refresh or pasting the url into the browser) Meteor reloads the entire application including the Meteor.user() object. At line 40 of client/templates/common/navigation.js you are probably trying to access Meteor.user().username but Meteor.user() hasn't yet loaded so you get the error. You need to defend against this in your code and/or show a loading template until your subscriptions and the user object are all ready.
The first line of the error dump points to the error:
TypeError: Cannot read property 'username' of undefined at Blaze.TemplateInstance.
(http://localhost:3000/app/client/templates/common/navigation.js?hash=142e989d312ba94a4b875a71e5e557bdd5255272:3:40)
The :40 at the end there is the line number the error occurred on.

is there a way to test google data feed? not sure what to make of these errors

It's on 2 different htmls in the site and it's not working on any of the various versions of the site I have done. Is it in my coding or is there an issue with the feed or WHAT?? please help!!
http://www.clockshop.org/calendar.html
these are the errors:
Uncaught TypeError: undefined is not a function
Uncaught TypeError:
Cannot read property 'setAttribute' of null
The feed is not working because "This API is a subject to the Deprecation Policy and will be shutdown on November 17, 2014. Please use APIv3 instead." developers.google.com/google-apps/calendar/v2/… -- "
Currently, you have 2 different javascript errors at your page: In your main.js you're calling the function waypoint() which is not declared. You have to download waypoint.js and include it before the include of the main.js. Then there's
document.getElementById('jsSourceFinal').setAttribute('style', 'display:none');
throwing an error because the element with the id jsSourceFinal does not exist.
This is also called in your main.js by the function handleGDError(e) {} which is a callback function for the Google data JS client library.
In addition, the loadCalendar('https://www.google.com/calendar/feeds...') at the end of your HTML does not work because this url gets the server response 403 forbidden.

chrome not letting me use sessions methods?

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?

Filepicker.io SecurityError

I took the demo on github, and ran it on my local server. I can pull up the upload dialog and select a photo, but it keeps throwing a javascript error when i choose upload:
Uncaught Error: SecurityError: DOM Exception 18
Which then freezes the page at a spinning uploading screen. My API key has been entered as well. Any suggestions to get this working would be appreciated.
According to what seems to be the canonical Stack Overflow issue on this topic (Uncaught Error: SECURITY_ERR: DOM Exception 18 when I try to set a cookie), it likely has to do with the fact that the window.history.pushState call that the dialog makes is not happy when run via localhost directly.

Categories

Resources