Commits

Alexey Kozlov  committed 371ce4f

version 1.3

  • Participants
  • Parent commits cb500a8

Comments (0)

Files changed (2)

File manifest.json

 {
    "name": "L-Cube",
    "description": "Making breadcrumbs from URL",
-   "version": "1.2",
+   "version": "1.3",
    "background_page": "background.html",
    "options_page": "options.html",
    "page_action": {
  </style>
  <script type="text/javascript">
 
-  chrome.tabs.executeScript(null, {code: "l=document.getElementsByTagName('link');s={};for(i in l){if(l[i].rel=='prev'||l[i].rel=='next'){s[l[i].rel] = l[i].href;}}chrome.extension.sendRequest([document.URL,s]);"});
+  chrome.tabs.executeScript(null, {code: "l=document.getElementsByTagName('link');s={};k=true;du=document.URL;r=/\\d+(?!.*\\d+)/;for(i in l){if(l[i].rel=='prev'||l[i].rel=='next'){s[l[i].rel]=l[i].href;k=false;}}if(k&&r.test(du)){n=Number(String(du.match(r)));s['next']=du.replace(r,String(n+1));if(n>0){s['prev']=du.replace(r,String(n-1));}}chrome.extension.sendRequest([du,s]);"});
 
   chrome.extension.onRequest.addListener(function(request) {
     parse_url(request[0]);