A few pages are "hidden" in the Sonos API documentation - sonos

Some nodes in the Sonos API documentation link to a few other nodes which cannot be accessed, because they return the "403 Forbidden" response:
1) http://musicpartners.sonos.com/node/134
links to /node/146
2) http://musicpartners.sonos.com/node/407
links to /node/218
3) /node/434 links to /node/110 and /node/218
Please make these 3 pages accessible (/node/110, /node/146, /node/218).

This is due to outdated documentation pages on our side - Thanks for catching it!
The /node/146 page was the old Authentication page, see the updated version here: http://musicpartners.sonos.com/node/462.
The /node/218 page was the old Custom Error Handling page, see the new and improved Error Handling page here: http://musicpartners.sonos.com/node/460.
The /node/110 page was the old Standard Error Handling page, see the Error Handling page for details: http://musicpartners.sonos.com/node/460.

Related

I am needing to do an internal link that is in FAQs on a site using Vue 3 and Inertia.js?

I have an array of content coming from a database that will be displayed on a page as a group of FAQs. Some of the content will have links to other internal pages on the site. How do I link to the pages using Inertia's link component so that a full page refresh doesn't happen?
It depends on what is returned after using the link. If you return a full view in the response, the page is reloaded. If you return a small JSON object or something else, you can process it without full loading.

Instagram Login Failure Issue

enter image description here
When i try to login my instagram through the web this blank screen doesn't load. Tried clearing cache and cookies on the browser but still the issue persists. On inspecting the page on console this error is displayed
https://i.instagram.com/api/v1/business/account/get_web_pro_onboarding_eligibility/
The resource https://www.instagram.com/static/bundles/es6/FeedSidebarContainer.css/f627ebef4169.css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
Subsequent non-fatal errors won't be logged; see https://fburl.com/debugjs.
Same errors here. Feed site is empty. I can open my profile site or profiles from other users, that is working.
See the screenshot. On the feed site is a GET request and in the status I get "429 Too Many Requests". I have no glue what is going wrong here. On my two other Instagram profiles the feed is working.

(Karate) How to intercept the XHR request response code?

I am testing a login functionality on a 3rd party website. I have this url example.com/login . When I copy and paste this into the browser (chrome), page sometimes load, but sometime does not (empty blank white page).
The problem is that I have to run a script on this page to click one of the elements (all the elements are embedded inside #shadow-root). If the page loads, no problem, script is evaluated successfully. But page sometimes does not load and it returns a 404 in response to an XHR request, and as a result, my * eval(scrip("script") step returns "js eval failed...".
So I found the solution to refresh the page, and to do that, I am considering to capture the xhr request response. If the status code is 404, then refresh the page. If not, continue with the following steps.
Now, I think this may work, but I do not know how to implement karate's Intercepting HTTP Requests. And firstly, is that something doable?
I have looked into documentation here, but could not understand the examples.
https://github.com/karatelabs/karate/tree/master/karate-netty
Meanwhile, if there is another way of refreshing the page conditionally, I will be more than happy to hear about it. Thanks anyone in advance.
First, using JavaScript you should be able to handle shadow roots: https://stackoverflow.com/a/60618233/143475
And the above answer links to advanced examples of executing JS in the context of the current page. I suggest you do some research into that, try to take the help of someone who knows JS, the DOM and HTML well - and you should be find a way to know if the XHR has been made successfully or not - for e.g. based on whether some element on the page has changed etc.
Finally here is how you can do interception: https://stackoverflow.com/a/61372471/143475

Additional pages with SPA

I'm creating a SPA app using Durandal and I would like to include a credit card payment facility. The guys that I'm looking at requires you to give return URLs to success, cancel and a view other pages, is that possible?
To me it would be breaking the 'single page' part of SPA, but is it possible? Could I do it all in a window?
Disclaimer: I don't know Durandal, but you would solve this in an SPA using either "hashbang URIs" or actually re-serving the SPA in your webserver for the requested return URI and adjusting the content using the same technique as hangbash URIs but using history.pushstate/history.popstate instead, see here: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
A more general article from Google is available here that covers the same principle: https://developers.google.com/webmasters/ajax-crawling/
This "works" because SPAs are SPAs only in that the browser requests a new HTML document from the server once (or in your case, twice), the SPA should still be updating the history and address-bar state of the UA as the user navigates the application, just as though it were a regular multi-page application.
A great example of this is GitHub's source navigator: Try here ( https://github.com/angular/angular.js ) and navigate the repository, observe that the contents of the file-listing change as does the address bar, but your browser doesn't reload the whole page... yet if you copy+paste the (modified) address bar address into a new browser window, you get the same page back.
I looked into doing credit card processing from a SPA and the best option I had found was Stripe. They supply a javascript file that looks like it would work, I never implemented it on my project due to time constraints so I can't confirm that it works but it looked very promising.
IFRAMEs are quite good for this sort of thing. You can use jQuery to hook an event handler to the page load event and this will tell you when the other end has responded. Load the 3rd party page into the IFRAME and serve response pages on the URLs you provide to the service provider. As mentioned by others you can use routes to identify the response pages. The IFRAME will stop the round-tripping from mucking up your application state and in fact it is possible to put script in your response pages that dot-notates its merry way up the DOM and into your app.

MvcSiteMapProvider not resolving depending on RouteData

I am attempting to use the MvcSiteMapProvider with an MVC 4 site, and am having a problem in a section of the site which has (for example) a Project Listing page and child Project Detail page.
When you access the Detail page, the ID of the entity selected from the Listing is specified in URL e.g.:
~/Project/2/Detail
I have not made the Detail page a Dynamic node, as I do not want the Site Map Provider to provide any enhanced functionality. Essentially I want the Site Map Provider to ignore the projectID URL parameter and always just map to the Detail action.
Unfortunately, I am having the following problem:
If the app starts with the first request being for the Listing page,
then the user can click through to any project and the SiteMap
matches the Detail page just fine.
If the app starts with a request
for the Detail page, then the SiteMap only matches the Detail page if
the URL contains the ProjectID of the first request, i.e. if you
visit any other Project then the SiteMap currentnode is null.
I have tried to disable caching, enable caching with a long duration, and have even been digging around in the source code with no success. The inconsistent behaviour suggests it is a bug. Any help would be greatly appreciated.
This problem is resolved.
See thread on MvcSiteMapProvider's github at:
https://github.com/maartenba/MvcSiteMapProvider/issues/154