Basically I want to check if history.back() which I call on button click takes me to an external page and block the button in this case
How can I check the url before calling history.back()?
67 views Asked by Homo Civicus At
1
There are 1 answers
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in ANGULAR
- Firebase link existing user to anonymous account?
- It doesnt always show all the books on my homepage
- Google adsense ads.txt status cannot be not found
- When I navigate to the URL'http://localhost:4200/', it redirects me back
- Ionic Angular Standalone ion-icon are not showing at all
- How to make Angular understand that view child is of a specific type, not a general ElementRef?
- vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
- How to perform CRUD operations on a static JSON array in Angular? (without API)
- Ngrx props<>() method in createAction()
- How to animate rotation of an image inside input control?
- Detecting click inside and outside of the listening component in Angular
- Angular - type guard not narrowing types
- In node_modules file i am getting Angular genric error while using fontawesome in angular12
- Angular 16 sending null values to API
- GoogleCloud Error: Not Found The requested URL was not found on this server
Related Questions in URL
- how do I change a URL with form to include additional selection
- Blog Post URL In flutter Web
- Why does RFC 3986 (URI generic syntax) declare the "host" component to be case-insensitive when the syntax rules show it to be case-sensitive?
- Non-Expiring Direct Link Like When Clicked It Will Download Without Landing Any Page
- Curl URL syntax for uploading files
- Send a json command to an app at a known port/address?
- How do I resolve this error ? "ERR_TOO_MANY_REDIRECTS"
- I'm using the googlesearch library in Colab, but I can't import my websites to a list. How can I do that?
- Sharepoint document library URL Rewrite
- Apache2 redirection results in wrong URL
- Vue / Vitest : issues in snapshots with dynamic import assets URL
- How to redirect to the landing page when the domain name is searched?
- find out filename from URL
- How do I ping a website to see if its valid before entering?
- Unable to download CSV file from web URL with runtime using python
Related Questions in NAVIGATION
- Why might react-router navigate(-1) go back two routes/pages?
- In @react-navigation's Tab.Navigator, I aim to lock the final screen while allowing the rest to scroll
- (ros melodic) Lidar odometry is not working well
- How to jump to a div using keyboard shortcuts?
- Flutter: How to use a BottomSheet in a BottomNavigationBar?
- Force security constraint managed 403 error when hitting restricted page with h:commandLink
- In Entity Framework Core, how to populate self-referencing navigation collection without additional Include (using only entities already tracked)?
- Blogger next previous navigations missing
- Cannot achieve live navigation using js,openstreetmap and leaflet
- Im using mapbox sdk navigation v2 and have a problem with the cycling view
- Assigning sensor information to image coordinates
- Blazor InteractiveServer navigate to external link whilst JWT added to the request headers?
- Navigate to a different page from the side bar drawer without using the bottom navigation bar using persistent flutter package
- WPF C# - Textblock inputs not saving on Navigation to new page?
- React Chrome vs Firefox Navigation is not defined
Related Questions in BROWSER-HISTORY
- Creating custom history back and forwards buttons using a React hook
- Browser Back Button Redirect Bug
- TypeError: Cannot read properties of undefined (reading 'push') in React
- Angular back button from external app with skipLocationChange
- History API in Safary | issue accessing a link with anchor
- React useNavigate() not triggering window.addEventListener('locationchange' / history
- what is __PRIVATE_NEXTJS_INTERNALS_TREE for?
- How to enable use of the forward button in my vanilla typescript single page app (code examples included)
- Unable to Intercept Browser Back Button Press in Next.js Success Page
- url is incorrect in `load` after pushState and navigation
- Unblock react history push on particular condition
- Preventing creation of history entry when changing language in Next.js
- Test history.block function callback with Jest
- How can I check the url before calling history.back()?
- Why am I not able to delete my browser history anymore on my Mozilla firefox pc
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The short answer is that you cannot get the previous external web url. Check out this history API: https://developer.mozilla.org/en-US/docs/Web/API/History
However, if the external page is not important by its value, but only for being external one, you could trick it. Just preserve a route state when navigation across your application.
When a user navigates from your app to other page in the app, set a state indicating that the previous page was internal one. Then, once a user clicks your button, check that state and act according to its value.
Example:
Pass data on navigation:
Read data:
Then, when a user clicks the button, act in accordance to
this.isInternalvalue.