Explorer Page and Module Finder for your browser - Mendix Forum

Explorer Page and Module Finder for your browser

6

Hi all!

I've created a simple new bookmarklet that allows you to get the module and page name of the explorer and display it in your browser. This will allow you to easily find the same page you're looking at in the browser, in your Mendix explorer.


Back in the day we used to have one that worked perfectly, however, with the new React modeler, the older version didn't work. This new version supports both the new React and Dojo versions :)!


History:

v1.1: Initial release

v1.2: Added browser support, included Dojo compatibility

v1.3: Popup support

v1.4: Fixed Dojo Popup Bug / Added Styled Version

v1.5: Update with a new clean Toast version that autocloses after 5 seconds

v1.6: Added Mendix Version Number and added New Mendix Inspector Version (Update: 20/2/26 - removed the inspector version - creating that as a seperate Chrome Extension tool with many more features)

v1.7: Fixed a bug that showed a Copy Failed


Example of the returned toast message:





How it works:

1. Go to your favourite browser and press add a new bookmark.

2. Set the name as Mendix Page Finder (or something similar)

3. Inside the URL section; paste one of the javascripts I added underneath (Minimal or Styled)

4. Open both a Dojo (Mx 9) and or React (Mx 11) modeler project and see your page name (you can even try it on the community pages here ;) )

5. The page name is automatically pasted to your clipboard

6. Go to your Mendix Modeler, paste the name inside the explorer search field and that's the page you were looking at in the browser (if a page is not a Mendix based page, the javascript returns Unknown.

7. If it works, feel free to like this post. If it doesn't, please let me know which browser you are using and what is happening. I will look into it for you!


v1.7 (Toast Version - Autoclose after 5 seconds, Auto-copy to clipboard, Mendix Version Number)

javascript:(function(){var v='?',p='',m='Unknown',n='Unknown',popup=false;try{if(window.mx&&mx.version)v=mx.version;var modal=document.querySelector('.modal-dialog');if(modal){popup=true;var ids=modal.querySelectorAll('[id]');for(var i=0;i<ids.length;i++){var parts=ids[i].id.split('.');if(parts.length>=3){m=parts[1];n=parts[2].split('$')[0];break;}}}else{if(window.mx&&mx.ui&&mx.ui.getContentForm){var form=mx.ui.getContentForm();if(form&&form.path)p=form.path;}if(!p&&window.history&&history.state&&history.state.pageName)p=history.state.pageName;if(p){p=p.replace('.page.xml','').replace(/\//g,'.');var dot=p.indexOf('.');if(dot>-1){m=p.substring(0,dot);n=p.substring(dot+1);}else{n=p;}}}}catch(e){n=e.message||'Error';}function showToast(copied){var old=document.getElementById('mx-toast');if(old)old.remove();var ok=copied==='Copied!';var t=document.createElement('div');t.id='mx-toast';t.style.cssText='position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#fff;border-radius:8px;padding:12px 16px;box-shadow:0 4px 12px rgba(0,0,0,.15);z-index:999999;font-family:system-ui;display:flex;align-items:center;gap:16px';var inner=document.createElement('div');inner.style.cssText='display:flex;align-items:center;gap:12px';inner.innerHTML='<svg width="20" height="20" viewBox="0 0 20 20" fill="none"><circle cx="10" cy="10" r="9" fill="'+(ok?'#22c55e':'#ef4444')+'"/><path d="'+(ok?'M6 10l3 3 5-6':'M6 6l8 8M14 6l-8 8')+'" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg><span style="font-size:14px"><span style="color:#6b7280">'+m+'</span><span style="color:#9ca3af">.</span><b style="color:#111">'+n+'</b>'+(popup?' <span style="color:#6b7280">[POPUP]</span>':'')+'</span>';var meta=document.createElement('div');meta.style.cssText='display:flex;align-items:center;gap:8px;margin-left:12px';var badge=document.createElement('span');badge.style.cssText='background:#f3f4f6;color:#6b7280;font-size:11px;padding:2px 6px;border-radius:4px;font-family:monospace';badge.textContent=v;var status=document.createElement('span');status.style.cssText='font-size:12px;color:'+(ok?'#22c55e':'#ef4444');status.textContent=copied;var btn=document.createElement('button');btn.style.cssText='background:none;border:none;color:#9ca3af;cursor:pointer;font-size:20px;padding:4px';btn.innerHTML='&times;';btn.addEventListener('click',function(){t.remove();});meta.appendChild(badge);meta.appendChild(status);meta.appendChild(btn);t.appendChild(inner);t.appendChild(meta);document.body.appendChild(t);setTimeout(function(){t.style.transition='opacity .3s';t.style.opacity='0';setTimeout(function(){t.remove();},300);},5000);}function fallbackCopy(text){var ta=document.createElement('textarea');ta.value=text;ta.style.cssText='position:fixed;top:-9999px;left:-9999px';document.body.appendChild(ta);ta.focus();ta.select();var ok=false;try{ok=document.execCommand('copy');}catch(e){}ta.remove();return ok;}if(n!=='Unknown'){if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(n).then(function(){showToast('Copied!');}).catch(function(){var ok=fallbackCopy(n);showToast(ok?'Copied!':'Copy failed');});}else{var ok=fallbackCopy(n);showToast(ok?'Copied!':'Copy failed');}}else{showToast('');}})();


Like & Share!


Cheers and have a great day!

Posted
6 comments

Thanks Tim, works amazing!

Created

You are the best Tim!

Created

Works great, thanks Tim!

Created

Thanks for sharing!

Created

Perfect! Thanks!

Created

Works smoothly. Thanks for sharing.

Created