Posts

Showing posts with the label cross-browser

angularjs 6 python django rest framework crossdomain api call issue

angularjs 6 python django rest framework crossdomain api call issue I have configured django rest framework with python 3. And the API is working fine in postman. But am facing a cross domain issue, when I call this api through my angualar 6 project. OS: Mac OS I have included oauth2 for authentication. It works well with postman API Url: http://127.0.0.1:7777/api/v1/token/ Angular 6 website url: http://localhost:5000/#/login When I called this with angualrjs it shows the following error. Mozilla: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:7777/api/v1/token/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Safari: Failed to load resource: Origin http://localhost:5000 is not allowed by Access-Control-Allow-Origin. XMLHttpRequest cannot load http://127.0.0.1:7777/api/v1/token/. Origin http://localhost:5000 is not allowed by Access-Control-Allow-Origin. Chrome: Failed to load http://127.0.0.1:7777/ap...

After enabling full screen through f11 disable full screen through javascript

After enabling full screen through f11 disable full screen through javascript By pressing below button i am able to enable and disable fullscreenmode but after f12 is pressed i am not enable to disable fullscreen mode.I refered other answers they have gave only a ways to detect whether window is in full screen mode or not .I am not able to get code for disabling full screen mode from fullscreen(made through f11 key).I tried by triggering f11 through code but it didnt work.Is there any solution for it in all the browsers? Html code: <button id="fullbutton" width="60px" height="60px" alt="logo" onclick="toggleFullScreen(this)">On</button> Javascript code : function toggleFullScreen(element) { //first part if((window.fullScreen) || (window.outerWidth === screen.width && window.outerHeight == screen.height)) { console.log("full screen is enabled ") if (document.exitFullscreen) document.exitFullscreen(...