How to get $ to select css in google chrome - google-chrome-devtools

I'm on version 58 of Google Chrome on MacOS. When I try to do a $('#userName') type selector, I get the following:
$('#userName')
VM193870:1 Uncaught TypeError: $ is not a function
at <anonymous>:1:1
(anonymous) # VM193870:1
However, according to this page, https://developers.google.com/web/tools/chrome-devtools/console/expressions#select_elements, I should be able to do that without any problems.
$$('#userName') does work and returns the list of a single element.
$$('#userName')
[input#userName.ng-untouched.ng-pristine.ng-invalid.mat-input-element]
Is there something I need to enable?

Further investigation revealed that the angular 2 app I'm working on somehow clobbers the $ operator. If you are experiencing this issue, first check to see if it will work on another website (use a different tab). It may also be an extension that clobbers it.

Related

Do PayPal smart buttons require an intent?

I recently created some buttons and copied the code directly from their website. I copied and pasted exactly what they gave me. However, when I checked this morning I noticed that there was a warning in the console. When I checked their documentation I saw that leaving the "intent" parameter empty defaulted to "capture". Now, the buttons give me the following warning: "Expected intent=subscription to be passed to SDK, but got intent=capture". I don't see "subscription" as an intent value mentioned in their documentation. Has anyone experienced this problem?
Below is the warning given in the console:
smart_button_validation_error_expected_intent_subscription
Expected intent=subscription to be passed to SDK, but got intent=capture
The warning was added recently; that intent=subscription query string parameter will be required in some future time.
The future requirement hasn't made its way into the documentation yet, but I expect you'll see it there soon.
Basically, add intent=subscription to your SDK line now when using subscriptions for them to be future-proof.
This hardly seems like a future proofing... What about if I want to use both createOrder and createSubscription with the same sdk? Adding intent=subscription breaks createOrder. What would be a proper solution in this case?

Could not locate login item in the caller's bundle error when using SMLoginItemSetEnabled

I'm trying to get my swift Mac app to launch at login using the method described in this page: https://theswiftdev.com/how-to-launch-a-macos-app-at-login/
However, I keep getting the following errors as soon as I call SMLoginItemSetEnabled:
Could not locate login item com.domain.LauncherApplication in the caller's bundle
Could not enable login item: com.domain.LauncherApplication: 3: No such process
I checked that the launcher app ID is correct multiple times, I tried changing it and changing its version number. I even tried cleaning the project and moving the base app to /Applications but I always get these error messages.
Any idea what the problem might be? (Notice the solution must not require me to disable App Sandboxing)
OK, I found the problem but it took a long time since it was so sneaky: In the Copy File Build Phase section I entered "Contents/Library/LoginItem" as the subpath instead of "Contents/Library/LoginItems" (notice the 's' in the end - can't believe I missed it). So thank you #vadian! You were absolutely right.

Can someone help me out with changing my invocation phrase?

For a project that I'm working on that is in Alpha right now, I used to use an invocation ''talk to XXX''. Now that I want to deploy the Action to Beta, I want to change the invocation name/phrase as well. So I changed it to ''talk to YYY'', which is the suggested input field in the simulator as well. But when I want to test this in the simulator, I get the following error message:
Invocation Error:
You cannot use standard Google Assistant features in the Simulator. If you want to try them, use Google Assistant on your phone or other compatible devices.
For some reason, if I ignore the suggested input chip (which says ''talk to YYY'') and type in ''talk to XXX'' (the old invocation phrase) everything still works though. Seems that I'm missing something and Google support can't answer me, does someone know what I can do to successfully deploy to Beta?
When I get that message, it's usually a problem with the Console. A refresh of the page—and sometimes a simple retry—usually does the trick.
You could also try "Change Version" to make sure you're pointed to "Draft".

Facebook page is not loading properly in mx:html (Adobe AIR) outside IDE

Adobe AIR application which was working perfectly earlier; is not working now. No idea whether it is due to any recent change in Facebook or Adobe AIR.
I have added the component mx:HTML to display http://facebook.com content. In the development environment (Flash Builder 4.5) after logging in facebook successfully; I can see the TimeLine contents and updates properly. But after build when executed outside the IDE; I am able to login facebook but the timeline or updates are not being displayed properly.
Anybody facing similar issue and has a fix; please provide the solution.
uncaughtScriptException gives following two errors...
TypeError: Result of expression 'bigPipe' [undefined] is not an object.
ReferenceError: Can't find variable: console
I have similar issue, if you catch the javascript errors you will notice that facebook is using some library that fails in AIR, then if you google that exact error you will find similar issues. My solution was to use the FB API and reimplement the functionality(in my case share) , other alternatives is to fix that library or FB code to make it work. I don't remember the details but I fixed it a week ago.
Check the docs for catching the JS errors uncaughtScriptException
I am wondering if that library has code for each browser that it supports and on AIR it fails, maybe changing useragent will help, you need to check the javascript code to see where it fails

Dynamically loaded javascript doesn't show in sources panel?

For example, I have an ajax request and it returns <script src='buggy.js'></script>.
Problem is, it doesn't show up in sources or resources panel. That means I can't do all the cool stuffs like adding breakpoint and inspecting the elements as they run.
I could only see the source of the js file under the Network panel.
Is there anyway to make chrome add them to the sources panel?
Or how do you guys go about debugging dynamically added scripts?
Using Canary.
I was having the same problem, and I found a workaround that is better than the deliberate exception. It does still require changing the code as opposed to just setting a breakpoint inside the chrome dev tools.
I tried using the "//# sourceURL=dynamicScript.js" that was suggested as a workaround by the OP, but it still wasn't showing up for me unless it already existed in my tabs from a previous time when it produced an exception.
Coding a "debugger;" line forced it to break at that location. Then once it was in my tabs in the Sources panel, I could set breakpoints like normal and remove the "debugger;" line.
Please refer to https://developer.chrome.com/devtools/docs/javascript-debugging#breakpoints-dynamic-javascript
(Original link is broken-- archived link below)
http://web.archive.org/web/20141016164821/https://developer.chrome.com/devtools/docs/javascript-debugging#breakpoints-dynamic-javascript ("Breakpoints in Dynamic JavaScript").